mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Python: small start on global flow
need to actually have `OutNode`s
This commit is contained in:
@@ -9,7 +9,7 @@ private import DataFlowPublic
|
||||
// Nodes
|
||||
//--------
|
||||
|
||||
class DataFlowCall extends Call {
|
||||
class DataFlowCall extends CallNode {
|
||||
/** Gets the enclosing callable of this call. */
|
||||
abstract DataFlowCallable getEnclosingCallable();
|
||||
}
|
||||
@@ -103,10 +103,16 @@ predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo) {
|
||||
// Global flow
|
||||
//--------
|
||||
|
||||
class DataFlowCallable = FunctionValue;
|
||||
import semmle.python.pointsto.CallGraph
|
||||
|
||||
class DataFlowCallable = FunctionObject;
|
||||
|
||||
/** Gets a viable run-time target for the call `call`. */
|
||||
DataFlowCallable viableCallable(DataFlowCall call) { none() }
|
||||
DataFlowCallable viableCallable(DataFlowCall call) {
|
||||
exists(FunctionInvocation i |
|
||||
call = i.getCall() and
|
||||
result = i.getFunction())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a node that can read the value returned from `call` with return kind
|
||||
@@ -114,6 +120,9 @@ DataFlowCallable viableCallable(DataFlowCall call) { none() }
|
||||
*/
|
||||
OutNode getAnOutNode(DataFlowCall call, ReturnKind kind) { call = result.getCall(kind) }
|
||||
|
||||
// Extend OutNode here
|
||||
// Consider whether to use AST nodes rather than CFG nodes
|
||||
|
||||
//--------
|
||||
// Type pruning
|
||||
//--------
|
||||
|
||||
Reference in New Issue
Block a user