mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Python: fix VariableWrite and remove unneded step
This commit is contained in:
@@ -300,14 +300,6 @@ module LocalFlow {
|
||||
nodeTo.(CfgNode).getNode() = def.getDefiningNode()
|
||||
)
|
||||
or
|
||||
// Assignment to captured variables
|
||||
// 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() 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:`
|
||||
// nodeFrom is `f(42)`
|
||||
|
||||
@@ -72,7 +72,7 @@ private module CaptureInput implements Shared::InputSig<Location> {
|
||||
class VariableWrite extends ControlFlowNode {
|
||||
CapturedVariable v;
|
||||
|
||||
VariableWrite() { this = v.getAStore().getAFlowNode() }
|
||||
VariableWrite() { this = v.getAStore().getAFlowNode().(DefinitionNode).getValue() }
|
||||
|
||||
CapturedVariable getVariable() { result = v }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user