Python: remove non-local steps

This commit is contained in:
Rasmus Lerchedahl Petersen
2023-12-16 01:03:27 +01:00
parent 661ba1ca7b
commit b505778bc8

View File

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