Skip to content

Commit 336c066

Browse files
authored
Python: Remove pointless LocalSourceNodes
This gets rid of a large number of nodes that seemingly have no impact.
1 parent d325d2a commit 336c066

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ class LocalSourceNode extends Node {
4040
// Both of these preserve the identity of the underlying pointer, and hence we exclude these as
4141
// local source nodes.
4242
// We do, however, allow the post-update nodes that arise from object creation (which are non-synthetic).
43-
not this instanceof SyntheticPostUpdateNode
43+
not this instanceof SyntheticPostUpdateNode and
44+
// With similar reasoning to the above, we also exclude the following synthesized nodes
45+
not this instanceof SyntheticPreUpdateNode and
46+
not this instanceof KwOverflowNode and
47+
not this instanceof PosOverflowNode and
48+
not this instanceof KwUnpackedNode and
49+
not this instanceof IterableSequenceNode and
50+
not this instanceof IterableElementNode and
51+
// ESSA nodes are also superfluous
52+
not this instanceof EssaNode
4453
or
4554
this = any(ModuleVariableNode mvn).getARead()
4655
}

0 commit comments

Comments
 (0)