Skip to content

Commit 6a3d417

Browse files
committed
Rust: Implement enclosing callable for additional classes
1 parent bf07aa1 commit 6a3d417

File tree

109 files changed

+6
-689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+6
-689
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ final class NormalCall extends DataFlowCall, TNormalCall {
6464
/** Gets the underlying call in the CFG, if any. */
6565
override CallCfgNode asCall() { result = c }
6666

67-
override DataFlowCallable getEnclosingCallable() { none() }
67+
override DataFlowCallable getEnclosingCallable() {
68+
result = TCfgScope(c.getExpr().getEnclosingCallable())
69+
}
6870

6971
override string toString() { result = c.toString() }
7072

@@ -198,7 +200,7 @@ module Node {
198200
abstract DataFlowCall getCall();
199201
}
200202

201-
final private class ExprOutNode extends OutNode {
203+
final private class ExprOutNode extends ExprNode, OutNode {
202204
ExprOutNode() { this.asExpr() instanceof CallExpr }
203205

204206
/** Gets the underlying call CFG node that includes this out node. */

rust/ql/test/extractor-tests/canonical_path/CONSISTENCY/DataFlowConsistency.expected

Lines changed: 0 additions & 3 deletions
This file was deleted.

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

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)