Skip to content

Commit b505778

Browse files
committed
Python: remove non-local steps
1 parent 661ba1c commit b505778

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
@@ -304,7 +304,9 @@ module LocalFlow {
304304
// These are not covered by the `AssignmentDefinition`s in the case above,
305305
// as they are not necessarily live.
306306
nodeFrom.(CfgNode).getNode() = nodeTo.(CfgNode).getNode().(DefinitionNode).getValue() and
307-
nodeTo.asExpr() = any(VariableCapture::CapturedVariable c).getAStore()
307+
nodeTo.asExpr() = any(VariableCapture::CapturedVariable c).getAStore() and
308+
// Exclude assignments to parameters. These are from default values and not local.
309+
not nodeTo instanceof ParameterNode
308310
or
309311
// With definition
310312
// `with f(42) as x:`

0 commit comments

Comments
 (0)