File tree Expand file tree Collapse file tree
lib/semmle/python/dataflow/new/internal
test/experimental/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -322,6 +322,9 @@ SourceParameterNode parameterNode(Parameter p) { result.getParameter() = p }
322322abstract class ArgumentNode extends Node {
323323 /** Holds if this argument occurs at the given position in the given call. */
324324 abstract predicate argumentOf ( DataFlowCall call , ArgumentPosition pos ) ;
325+
326+ /** Gets the call in which this node is an argument, if any. */
327+ final DataFlowSourceCall getCall ( ) { this .argumentOf ( result , _) }
325328}
326329
327330/** A data flow node that represents a call argument. */
@@ -335,9 +338,6 @@ class ArgumentSourceNode extends ArgumentNode {
335338 predicate sourceArgumentOf ( DataFlowSourceCall call , ArgumentPosition pos ) {
336339 this = call .getArg ( pos )
337340 }
338-
339- /** Gets the call in which this node is an argument. */
340- final DataFlowSourceCall getCall ( ) { this .argumentOf ( result , _) }
341341}
342342
343343/**
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class MaximalFlowsConfig extends DataFlow::Configuration {
3535 override predicate isSink ( DataFlow:: Node node ) {
3636 exists ( node .getLocation ( ) .getFile ( ) .getRelativePath ( ) ) and
3737 not any ( CallNode c ) .getArg ( _) = node .asCfgNode ( ) and
38- not node instanceof DataFlow:: ArgumentSourceNode and
38+ not node instanceof DataFlow:: ArgumentNode and
3939 not node .asCfgNode ( ) .( NameNode ) .getId ( ) .matches ( "SINK%" ) and
4040 not exists ( DataFlow:: Node succ | DataFlow:: localFlowStep ( node , succ ) )
4141 }
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ abstract class RoutingTest extends InlineExpectationsTest {
4343 }
4444
4545 pragma [ inline]
46- private string fromFunc ( DataFlow:: ArgumentSourceNode fromNode ) {
46+ private string fromFunc ( DataFlow:: ArgumentNode fromNode ) {
4747 result = fromNode .getCall ( ) .getNode ( ) .( CallNode ) .getFunction ( ) .getNode ( ) .( Name ) .getId ( )
4848 }
4949
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class CallGraphConfig extends DataFlow::Configuration {
1111 override predicate isSource ( DataFlow:: Node node ) {
1212 node instanceof DataFlowPrivate:: ReturnNode
1313 or
14- node instanceof DataFlow:: ArgumentSourceNode
14+ node instanceof DataFlow:: ArgumentNode
1515 }
1616
1717 override predicate isSink ( DataFlow:: Node node ) {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class CallGraphConfig extends DataFlow::Configuration {
1111 node instanceof DataFlowPrivate:: ReturnNode
1212 or
1313 // These sources should allow for the non-standard call syntax
14- node instanceof DataFlow:: ArgumentSourceNode
14+ node instanceof DataFlow:: ArgumentNode
1515 }
1616
1717 override predicate isSink ( DataFlow:: Node node ) {
You can’t perform that action at this time.
0 commit comments