Skip to content

Commit d79eed5

Browse files
committed
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.
1 parent e76ab8c commit d79eed5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/ImportResolution.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ private import python
88
private import semmle.python.dataflow.new.DataFlow
99
private import semmle.python.dataflow.new.internal.ImportStar
1010
private import semmle.python.dataflow.new.TypeTracker
11+
private import semmle.python.dataflow.new.internal.DataFlowPrivate
1112

1213
/**
1314
* Python modules and the way imports are resolved are... complicated. Here's a crash course in how
@@ -279,7 +280,7 @@ module ImportResolution {
279280
or
280281
// Flow (local or global) forward to a later reference to the module.
281282
exists(DataFlow::Node ref | ref = getModuleReference(m) |
282-
DataFlow::localFlow(ref, result)
283+
simpleLocalFlowStepForTypetracking(ref, result)
283284
or
284285
exists(DataFlow::ModuleVariableNode mv |
285286
mv.getAWrite() = ref and

0 commit comments

Comments
 (0)