mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
Python: small test of local flow
This commit is contained in:
10
python/ql/test/library-tests/dataflow/local.ql
Normal file
10
python/ql/test/library-tests/dataflow/local.ql
Normal 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
|
||||
8
python/ql/test/library-tests/dataflow/test.py
Normal file
8
python/ql/test/library-tests/dataflow/test.py
Normal 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)
|
||||
Reference in New Issue
Block a user