Skip to content

Commit 451d36d

Browse files
authored
Python: Allow _some_ PostUpdateNodes
Specifically, allow the ones arising from calls, but not reads or writes. This should fix the tests.
1 parent c9c8259 commit 451d36d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ class LocalSourceNode extends Node {
2727
LocalSourceNode() {
2828
not comes_from_cfgnode(this) and
2929
not this instanceof ModuleVariableNode and
30-
not this instanceof PostUpdateNode
30+
not this.(PostUpdateNode).getPreUpdateNode() in [
31+
syntheticPostUpdateNode::storePreUpdateNode(), syntheticPostUpdateNode::readPreUpdateNode()
32+
]
3133
or
3234
this = any(ModuleVariableNode mvn).getARead()
3335
}

0 commit comments

Comments
 (0)