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:
Rasmus Wriedt Larsen
2022-11-01 15:43:16 +01:00
parent a5c3e850f1
commit 61410191e7
2 changed files with 3 additions and 3 deletions

View File

@@ -22,10 +22,10 @@ class Argument1RoutingConfig extends DataFlow::Configuration {
override predicate isSource(DataFlow::Node node) {
node.(DataFlow::CfgNode).getNode().(NameNode).getId() = "arg1"
or
exists(AssignmentDefinition def, DataFlowPrivate::DataFlowCall call |
exists(AssignmentDefinition def, DataFlow::CallCfgNode call |
def.getVariable() = node.(DataFlow::EssaNode).getVar() and
def.getValue() = call.getNode() and
call.getNode().(CallNode).getFunction().(NameNode).getId().matches("With\\_%")
call.getFunction().asCfgNode().(NameNode).getId().matches("With\\_%")
) and
node.(DataFlow::EssaNode).getVar().getName().matches("with\\_%")
}

View File

@@ -506,7 +506,7 @@ class With_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()