Python: Include all assignments in data flow paths

Like Ruby did in https://github.com/github/codeql/pull/12566
This commit is contained in:
Rasmus Wriedt Larsen
2023-07-13 16:42:24 +02:00
parent 9bd5694c3f
commit 46af77c1af
2 changed files with 20 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
def assign():
x = SOURCE # $ path-node
y = x
y = x # $ path-node
SINK(y) # $ path-node
@@ -10,7 +10,7 @@ def aug_assign():
x = SOURCE # $ path-node
z = ""
z += x
z += x # $ path-node
SINK(z) # $ path-node
@@ -41,7 +41,7 @@ def attribute():
x = X()
x.attr = SOURCE # $ path-node
y = x
y = x # $ path-node
SINK(y.attr) # $ path-node
@@ -81,7 +81,7 @@ def test_tuple():
def test_with():
x = SOURCE # $ path-node
with x as y:
with x as y: # $ path-node
SINK(y) # $ path-node
@@ -91,6 +91,6 @@ def test_match():
match x:
case y:
case y: # $ path-node
SINK(y) # $ path-node