File tree Expand file tree Collapse file tree
python/ql/lib/semmle/python/dataflow/new/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -299,11 +299,11 @@ module LocalFlow {
299299 nodeTo .( CfgNode ) .getNode ( ) = def .getDefiningNode ( )
300300 )
301301 or
302- // General definition
303- // TODO: remove other cases that are now redundant
302+ // Assignment to captured variables
303+ // These are not covered by the `AssignmentDefinition`s in the case above,
304+ // as they are not necessarily live.
304305 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 ( )
306+ nodeTo .asExpr ( ) = any ( VariableCapture:: CapturedVariable c ) .getAStore ( )
307307 or
308308 // With definition
309309 // `with f(42) as x:`
You can’t perform that action at this time.
0 commit comments