Skip to content

Commit 0741331

Browse files
committed
Rust: Address PR comments
1 parent fc15c0d commit 0741331

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

rust/ql/lib/codeql/rust/dataflow/DataFlow.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module DataFlow {
1919
* The value of a parameter at function entry, viewed as a node in a data
2020
* flow graph.
2121
*/
22-
final class ParameterNode = Node::SourceParameterNode;
22+
final class ParameterNode extends Node instanceof Node::SourceParameterNode { }
2323

2424
final class PostUpdateNode = Node::PostUpdateNodePublic;
2525

rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ module ModelGeneratorInput implements ModelGeneratorInputSig<Location, RustDataF
2020

2121
Type getType() { any() }
2222

23-
Callable getEnclosingCallable() { result = super.getEnclosingCallable().asCfgScope() }
23+
Callable getEnclosingCallable() {
24+
result = this.(Node::Node).getEnclosingCallable().asCfgScope()
25+
}
2426
}
2527

2628
private predicate relevant(Function api) {
@@ -91,7 +93,7 @@ module ModelGeneratorInput implements ModelGeneratorInputSig<Location, RustDataF
9193
}
9294

9395
Callable returnNodeEnclosingCallable(DataFlow::Node ret) {
94-
result = ret.getEnclosingCallable().asCfgScope()
96+
result = ret.(Node::Node).getEnclosingCallable().asCfgScope()
9597
}
9698

9799
predicate isOwnInstanceAccessNode(RustDataFlow::ReturnNode node) {

rust/ql/test/utils-tests/modelgenerator/CaptureSummaryModels.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import utils.modelgenerator.internal.CaptureModels
33
import utils.test.InlineMadTest
44

55
module InlineMadTestConfig implements InlineMadTestConfigSig {
6-
string getCapturedModel(Function c) { result = captureMixedFlow(c, _) }
6+
string getCapturedModel(Function c) { result = ContentSensitive::captureFlow(c, _) }
77

88
string getKind() { result = "summary" }
99
}

0 commit comments

Comments
 (0)