mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: Fix bug in argumentRoutingTest.ql
Since `DataFlowPrivate::DataFlowCall` only exists for calls resolved to a function, we didn't have any results before... but allowing any call helps things!
This commit is contained in:
@@ -22,10 +22,10 @@ class Argument1RoutingConfig extends DataFlow::Configuration {
|
|||||||
override predicate isSource(DataFlow::Node node) {
|
override predicate isSource(DataFlow::Node node) {
|
||||||
node.(DataFlow::CfgNode).getNode().(NameNode).getId() = "arg1"
|
node.(DataFlow::CfgNode).getNode().(NameNode).getId() = "arg1"
|
||||||
or
|
or
|
||||||
exists(AssignmentDefinition def, DataFlowPrivate::DataFlowCall call |
|
exists(AssignmentDefinition def, DataFlow::CallCfgNode call |
|
||||||
def.getVariable() = node.(DataFlow::EssaNode).getVar() and
|
def.getVariable() = node.(DataFlow::EssaNode).getVar() and
|
||||||
def.getValue() = call.getNode() and
|
def.getValue() = call.getNode() and
|
||||||
call.getNode().(CallNode).getFunction().(NameNode).getId().matches("With\\_%")
|
call.getFunction().asCfgNode().(NameNode).getId().matches("With\\_%")
|
||||||
) and
|
) and
|
||||||
node.(DataFlow::EssaNode).getVar().getName().matches("with\\_%")
|
node.(DataFlow::EssaNode).getVar().getName().matches("with\\_%")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -506,7 +506,7 @@ class With_call:
|
|||||||
|
|
||||||
|
|
||||||
def test_call():
|
def test_call():
|
||||||
with_call = With_call() #$ MISSING: arg1="SSA variable with_call" func=With_call.__call__
|
with_call = With_call() #$ arg1="SSA variable with_call" func=With_call.__call__
|
||||||
with_call()
|
with_call()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user