Python: small test of local flow

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-06-16 14:31:22 +02:00
parent 0abba238cc
commit f3e879a5ab
7 changed files with 47 additions and 8 deletions

View File

@@ -0,0 +1,10 @@
import python
import semmle.code.python.dataflow.DataFlow
from
DataFlow::Node fromNode,
DataFlow::Node toNode
where
DataFlow::localFlowStep(fromNode, toNode)
select
fromNode, toNode

View File

@@ -0,0 +1,8 @@
a = 3
b = a
def f(x):
y = x + 2 # would expect flow to here from x
return y - 2 # would expect flow to here from y
c = f(a)