Skip to content

Commit 9bf53f5

Browse files
committed
Rust: Get CFG scope and update expected results
1 parent d3f5b47 commit 9bf53f5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ module Node {
129129

130130
override CfgNode getCfgNode() { result = n }
131131

132-
override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCallable() }
132+
override CfgScope getCfgScope() { result = n.getAstNode().getEnclosingCfgScope() }
133133

134134
override Location getLocation() { result = n.getAstNode().getLocation() }
135135

rust/ql/test/extractor-tests/generated/MacroItems/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ uniqueNodeLocation
44
| file://:0:0:0:0 | BlockExpr | Node should have one location but has 0. |
55
| file://:0:0:0:0 | Param | Node should have one location but has 0. |
66
| file://:0:0:0:0 | PathExpr | Node should have one location but has 0. |
7+
| file://:0:0:0:0 | path | Node should have one location but has 0. |
78
missingLocation
8-
| Nodes without location: 5 |
9+
| Nodes without location: 6 |

0 commit comments

Comments
 (0)