Skip to content

Commit d7ddf69

Browse files
committed
Prepare LocalSourceNode for locality
Removes the dependence on the (global) `ModuleVariableNode.getARead()`. In the charpred we simply inline it. In `localSourceFlowStep` we discard any step _into_ a local source node.
1 parent 2d4da80 commit d7ddf69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class LocalSourceNode extends Node {
6767
or
6868
// We explicitly include any read of a global variable, as some of these may have local flow going
6969
// into them.
70-
this = any(ModuleVariableNode mvn).getARead()
70+
this.asCfgNode() = any(GlobalVariable v).getALoad().getAFlowNode()
7171
or
7272
// We include all scope entry definitions, as these act as the local source within the scope they
7373
// enter.
@@ -248,7 +248,7 @@ private module Cached {
248248
pragma[nomagic]
249249
private predicate localSourceFlowStep(Node nodeFrom, Node nodeTo) {
250250
simpleLocalFlowStep(nodeFrom, nodeTo, _) and
251-
not nodeTo = any(ModuleVariableNode v).getARead()
251+
not nodeTo instanceof LocalSourceNode
252252
}
253253

254254
/**

0 commit comments

Comments
 (0)