Skip to content

Commit 7f30996

Browse files
committed
Python: filter jump steps
1 parent 6a0ea18 commit 7f30996

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,9 @@ module LocalFlow {
301301
or
302302
// General definition
303303
// TODO: remove other cases that are now redundant
304-
nodeFrom.(CfgNode).getNode() = nodeTo.(CfgNode).getNode().(DefinitionNode).getValue()
304+
nodeFrom.(CfgNode).getNode() = nodeTo.(CfgNode).getNode().(DefinitionNode).getValue() and
305+
// remove jump steps (such as assignment of parameter default values)
306+
nodeFrom.getEnclosingCallable() = nodeTo.getEnclosingCallable()
305307
or
306308
// With definition
307309
// `with f(42) as x:`

0 commit comments

Comments
 (0)