File tree Expand file tree Collapse file tree
python/ql/src/semmle/code/python/dataflow/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ private import DataFlowPublic
99// Nodes
1010//--------
1111
12- class DataFlowCall extends Call {
12+ class DataFlowCall extends CallNode {
1313 /** Gets the enclosing callable of this call. */
1414 abstract DataFlowCallable getEnclosingCallable ( ) ;
1515}
@@ -103,17 +103,26 @@ predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo) {
103103// Global flow
104104//--------
105105
106- class DataFlowCallable = FunctionValue ;
106+ import semmle.python.pointsto.CallGraph
107+
108+ class DataFlowCallable = FunctionObject ;
107109
108110/** Gets a viable run-time target for the call `call`. */
109- DataFlowCallable viableCallable ( DataFlowCall call ) { none ( ) }
111+ DataFlowCallable viableCallable ( DataFlowCall call ) {
112+ exists ( FunctionInvocation i |
113+ call = i .getCall ( ) and
114+ result = i .getFunction ( ) )
115+ }
110116
111117/**
112118 * Gets a node that can read the value returned from `call` with return kind
113119 * `kind`.
114120 */
115121OutNode getAnOutNode ( DataFlowCall call , ReturnKind kind ) { call = result .getCall ( kind ) }
116122
123+ // Extend OutNode here
124+ // Consider whether to use AST nodes rather than CFG nodes
125+
117126//--------
118127// Type pruning
119128//--------
You can’t perform that action at this time.
0 commit comments