Python: Remove unwanted recursion

Depending on `localFlowStep` meant that this predicate ended up being
recursive with itself (by way of flow summaries which depend on API
graphs, which in turn depend on import resolution).

Changing this to use the simple local flow step predicate that we use
for type tracking should fix this issue.
This commit is contained in:
Taus
2022-11-18 13:50:50 +00:00
parent e76ab8c78c
commit d79eed533b

View File

@@ -8,6 +8,7 @@ private import python
private import semmle.python.dataflow.new.DataFlow private import semmle.python.dataflow.new.DataFlow
private import semmle.python.dataflow.new.internal.ImportStar private import semmle.python.dataflow.new.internal.ImportStar
private import semmle.python.dataflow.new.TypeTracker private import semmle.python.dataflow.new.TypeTracker
private import semmle.python.dataflow.new.internal.DataFlowPrivate
/** /**
* Python modules and the way imports are resolved are... complicated. Here's a crash course in how * Python modules and the way imports are resolved are... complicated. Here's a crash course in how
@@ -279,7 +280,7 @@ module ImportResolution {
or or
// Flow (local or global) forward to a later reference to the module. // Flow (local or global) forward to a later reference to the module.
exists(DataFlow::Node ref | ref = getModuleReference(m) | exists(DataFlow::Node ref | ref = getModuleReference(m) |
DataFlow::localFlow(ref, result) simpleLocalFlowStepForTypetracking(ref, result)
or or
exists(DataFlow::ModuleVariableNode mv | exists(DataFlow::ModuleVariableNode mv |
mv.getAWrite() = ref and mv.getAWrite() = ref and