mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
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:
@@ -8,6 +8,7 @@ private import python
|
||||
private import semmle.python.dataflow.new.DataFlow
|
||||
private import semmle.python.dataflow.new.internal.ImportStar
|
||||
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
|
||||
@@ -279,7 +280,7 @@ module ImportResolution {
|
||||
or
|
||||
// Flow (local or global) forward to a later reference to the module.
|
||||
exists(DataFlow::Node ref | ref = getModuleReference(m) |
|
||||
DataFlow::localFlow(ref, result)
|
||||
simpleLocalFlowStepForTypetracking(ref, result)
|
||||
or
|
||||
exists(DataFlow::ModuleVariableNode mv |
|
||||
mv.getAWrite() = ref and
|
||||
|
||||
Reference in New Issue
Block a user