mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
python: make DataFlowCall "publicly usable"
- add `getCallable`, `getArg` and `getNode` - these are `none` for summary calls - revert "external" uses (they had been changed to `DataFlowSourceCall`)
This commit is contained in:
@@ -12,8 +12,8 @@ class UnresolvedCallExpectations extends InlineExpectationsTest {
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(location.getFile().getRelativePath()) and
|
||||
exists(CallNode call |
|
||||
not exists(DataFlowPrivate::DataFlowSourceCall dfc | dfc.getNode() = call |
|
||||
// For every `CallNode`, there is a `DataFlowSourceCall` in the form of a `NonSpecialCall`.
|
||||
not exists(DataFlowPrivate::DataFlowCall dfc | dfc.getNode() = call |
|
||||
// For every `CallNode`, there is a `DataFlowCall` in the form of a `NonSpecialCall`.
|
||||
// It does not really count, as it has some abstract overrides. For instance, it does not
|
||||
// define `getCallable`, so checking for the existence of this guarantees that we are in a
|
||||
// properly resolved call.
|
||||
|
||||
@@ -15,7 +15,7 @@ class DataFlowCallTest extends InlineExpectationsTest {
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(location.getFile().getRelativePath()) and
|
||||
exists(DataFlowSourceCall call |
|
||||
exists(DataFlowCall call |
|
||||
location = call.getLocation() and
|
||||
element = call.toString()
|
||||
|
|
||||
|
||||
@@ -22,7 +22,7 @@ class Argument1RoutingConfig extends DataFlow::Configuration {
|
||||
override predicate isSource(DataFlow::Node node) {
|
||||
node.(DataFlow::CfgNode).getNode().(NameNode).getId() = "arg1"
|
||||
or
|
||||
exists(AssignmentDefinition def, DataFlowPrivate::DataFlowSourceCall call |
|
||||
exists(AssignmentDefinition def, DataFlowPrivate::DataFlowCall call |
|
||||
def.getVariable() = node.(DataFlow::EssaNode).getVar() and
|
||||
def.getValue() = call.getNode() and
|
||||
call.getNode().(CallNode).getFunction().(NameNode).getId().matches("With\\_%")
|
||||
|
||||
Reference in New Issue
Block a user