@@ -71,18 +71,24 @@ predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo) {
7171//--------
7272
7373/** Represents a callable */
74- class DataFlowCallable = FunctionObject ; // TODO: consider CallableValue
74+ class DataFlowCallable = CallableValue ;
7575
7676/** Represents a call to a callable */
7777class DataFlowCall extends CallNode {
78+ DataFlowCallable callable ;
79+
80+ DataFlowCall ( ) {
81+ this = callable .getACall ( )
82+ }
83+
7884 /** Gets the enclosing callable of this call. */
79- abstract DataFlowCallable getEnclosingCallable ( ) ;
85+ DataFlowCallable getEnclosingCallable ( ) { result = callable }
8086}
8187
8288/** A data flow node that represents a call argument. */
8389class ArgumentNode extends Node {
8490 ArgumentNode ( ) {
85- exists ( DataFlowCall call , int pos |
91+ exists ( DataFlowCall call , int pos |
8692 this .asCfgNode ( ) = call .getArg ( pos )
8793 )
8894 }
@@ -96,14 +102,9 @@ class ArgumentNode extends Node {
96102 final DataFlowCall getCall ( ) { this .argumentOf ( result , _) }
97103}
98104
99- import semmle.python.pointsto.CallGraph
100-
101105/** Gets a viable run-time target for the call `call`. */
102106DataFlowCallable viableCallable ( DataFlowCall call ) {
103- exists ( FunctionInvocation i |
104- call = i .getCall ( ) and
105- result = i .getFunction ( )
106- )
107+ result = call .getEnclosingCallable ( )
107108}
108109
109110private newtype TReturnKind = TNormalReturnKind ( )
0 commit comments