Skip to content

Commit bc8b1f2

Browse files
committed
Rust: rename asFunction to getFunction
1 parent 6253b5c commit bc8b1f2

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

rust/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ from
2323
where
2424
PartialFlow::partialFlow(source, sink, _) and
2525
p = source.getNode() and
26-
p.asParameter() = api.asFunction().getParamList().getAParamBase()
26+
p.asParameter() = api.getFunction().getParamList().getAParamBase()
2727
select sink.getNode(), source, sink, "There is flow from a $@ to $@.", source.getNode(),
2828
"parameter", sink.getNode(), "intermediate value"

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class QualifiedCallable extends TCallable {
3333

3434
string toString() { result = path }
3535

36-
R::Function asFunction() { result = api }
36+
R::Function getFunction() { result = api }
3737

3838
string getCanonicalPath() { result = path }
3939
}
@@ -53,7 +53,7 @@ module ModelGeneratorCommonInput implements
5353
}
5454

5555
QualifiedCallable getEnclosingCallable(NodeExtended node) {
56-
result.asFunction() = node.(Node::Node).getEnclosingCallable().asCfgScope()
56+
result.getFunction() = node.(Node::Node).getEnclosingCallable().asCfgScope()
5757
}
5858

5959
predicate isRelevantType(Type t) { any() }
@@ -84,13 +84,13 @@ module ModelGeneratorCommonInput implements
8484

8585
bindingset[c]
8686
string paramReturnNodeAsExactOutput(QualifiedCallable c, DataFlowImpl::ParameterPosition pos) {
87-
result = parameterExactAccess(c.asFunction().getParam(pos.getPosition()))
87+
result = parameterExactAccess(c.getFunction().getParam(pos.getPosition()))
8888
or
8989
pos.isSelf() and result = qualifierString()
9090
}
9191

9292
QualifiedCallable returnNodeEnclosingCallable(DataFlow::Node ret) {
93-
result.asFunction() = ret.(Node::Node).getEnclosingCallable().asCfgScope()
93+
result.getFunction() = ret.(Node::Node).getEnclosingCallable().asCfgScope()
9494
}
9595

9696
predicate isOwnInstanceAccessNode(DataFlowImpl::RustDataFlow::ReturnNode node) {
@@ -120,7 +120,7 @@ private module SummaryModelGeneratorInput implements SummaryModelGeneratorInputS
120120
}
121121

122122
QualifiedCallable getAsExprEnclosingCallable(NodeExtended node) {
123-
result.asFunction() = node.asExpr().getScope()
123+
result.getFunction() = node.asExpr().getScope()
124124
}
125125

126126
Parameter asParameter(NodeExtended node) { result = node.asParameter() }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import utils.test.InlineMadTest
55

66
module InlineMadTestConfig implements InlineMadTestConfigSig {
77
string getCapturedModel(Function f) {
8-
exists(QualifiedCallable qc | f = qc.asFunction() | result = Heuristic::captureSink(qc))
8+
exists(QualifiedCallable qc | f = qc.getFunction() | result = Heuristic::captureSink(qc))
99
}
1010

1111
string getKind() { result = "sink" }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import codeql.rust.dataflow.internal.ModelsAsData
66

77
module InlineMadTestConfig implements InlineMadTestConfigSig {
88
string getCapturedModel(Function c) {
9-
exists(QualifiedCallable qc | c = qc.asFunction() | result = Heuristic::captureSource(qc))
9+
exists(QualifiedCallable qc | c = qc.getFunction() | result = Heuristic::captureSource(qc))
1010
}
1111

1212
string getKind() { result = "source" }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import utils.test.InlineMadTest
55

66
module InlineMadTestConfig implements InlineMadTestConfigSig {
77
string getCapturedModel(Function f) {
8-
exists(QualifiedCallable qc | f = qc.asFunction() |
8+
exists(QualifiedCallable qc | f = qc.getFunction() |
99
result = ContentSensitive::captureFlow(qc, _, _, _, _)
1010
)
1111
}

0 commit comments

Comments
 (0)