mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Rust: rename asFunction to getFunction
This commit is contained in:
@@ -23,6 +23,6 @@ from
|
||||
where
|
||||
PartialFlow::partialFlow(source, sink, _) and
|
||||
p = source.getNode() and
|
||||
p.asParameter() = api.asFunction().getParamList().getAParamBase()
|
||||
p.asParameter() = api.getFunction().getParamList().getAParamBase()
|
||||
select sink.getNode(), source, sink, "There is flow from a $@ to $@.", source.getNode(),
|
||||
"parameter", sink.getNode(), "intermediate value"
|
||||
|
||||
@@ -33,7 +33,7 @@ class QualifiedCallable extends TCallable {
|
||||
|
||||
string toString() { result = path }
|
||||
|
||||
R::Function asFunction() { result = api }
|
||||
R::Function getFunction() { result = api }
|
||||
|
||||
string getCanonicalPath() { result = path }
|
||||
}
|
||||
@@ -53,7 +53,7 @@ module ModelGeneratorCommonInput implements
|
||||
}
|
||||
|
||||
QualifiedCallable getEnclosingCallable(NodeExtended node) {
|
||||
result.asFunction() = node.(Node::Node).getEnclosingCallable().asCfgScope()
|
||||
result.getFunction() = node.(Node::Node).getEnclosingCallable().asCfgScope()
|
||||
}
|
||||
|
||||
predicate isRelevantType(Type t) { any() }
|
||||
@@ -84,13 +84,13 @@ module ModelGeneratorCommonInput implements
|
||||
|
||||
bindingset[c]
|
||||
string paramReturnNodeAsExactOutput(QualifiedCallable c, DataFlowImpl::ParameterPosition pos) {
|
||||
result = parameterExactAccess(c.asFunction().getParam(pos.getPosition()))
|
||||
result = parameterExactAccess(c.getFunction().getParam(pos.getPosition()))
|
||||
or
|
||||
pos.isSelf() and result = qualifierString()
|
||||
}
|
||||
|
||||
QualifiedCallable returnNodeEnclosingCallable(DataFlow::Node ret) {
|
||||
result.asFunction() = ret.(Node::Node).getEnclosingCallable().asCfgScope()
|
||||
result.getFunction() = ret.(Node::Node).getEnclosingCallable().asCfgScope()
|
||||
}
|
||||
|
||||
predicate isOwnInstanceAccessNode(DataFlowImpl::RustDataFlow::ReturnNode node) {
|
||||
@@ -120,7 +120,7 @@ private module SummaryModelGeneratorInput implements SummaryModelGeneratorInputS
|
||||
}
|
||||
|
||||
QualifiedCallable getAsExprEnclosingCallable(NodeExtended node) {
|
||||
result.asFunction() = node.asExpr().getScope()
|
||||
result.getFunction() = node.asExpr().getScope()
|
||||
}
|
||||
|
||||
Parameter asParameter(NodeExtended node) { result = node.asParameter() }
|
||||
|
||||
@@ -5,7 +5,7 @@ import utils.test.InlineMadTest
|
||||
|
||||
module InlineMadTestConfig implements InlineMadTestConfigSig {
|
||||
string getCapturedModel(Function f) {
|
||||
exists(QualifiedCallable qc | f = qc.asFunction() | result = Heuristic::captureSink(qc))
|
||||
exists(QualifiedCallable qc | f = qc.getFunction() | result = Heuristic::captureSink(qc))
|
||||
}
|
||||
|
||||
string getKind() { result = "sink" }
|
||||
|
||||
@@ -6,7 +6,7 @@ import codeql.rust.dataflow.internal.ModelsAsData
|
||||
|
||||
module InlineMadTestConfig implements InlineMadTestConfigSig {
|
||||
string getCapturedModel(Function c) {
|
||||
exists(QualifiedCallable qc | c = qc.asFunction() | result = Heuristic::captureSource(qc))
|
||||
exists(QualifiedCallable qc | c = qc.getFunction() | result = Heuristic::captureSource(qc))
|
||||
}
|
||||
|
||||
string getKind() { result = "source" }
|
||||
|
||||
@@ -5,7 +5,7 @@ import utils.test.InlineMadTest
|
||||
|
||||
module InlineMadTestConfig implements InlineMadTestConfigSig {
|
||||
string getCapturedModel(Function f) {
|
||||
exists(QualifiedCallable qc | f = qc.asFunction() |
|
||||
exists(QualifiedCallable qc | f = qc.getFunction() |
|
||||
result = ContentSensitive::captureFlow(qc, _, _, _, _)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user