Files
codeql/python/ql/test/experimental/dataflow/use-use-flow/read_explosion.py
Rasmus Lerchedahl Petersen f138fc0d2d Python: Test demonstrating need for phi-read-nodes
Or for a data flow node filling that role, at least.
2023-11-21 13:54:02 +01:00

36 lines
692 B
Python

# This test file is inspired by
# `csharp/ql/test/library-tests/dataflow/local/UseUseExplosion.cs`
# but with `n=3` kept small, since we do have the explosion.
cond = ...
# global variables are slightly special,
# so we go into a function scope
def scope():
x = 0
if(cond > 3):
if(cond > 2):
if(cond > 1):
pass
else:
use(x)
else:
use(x)
else:
use(x)
if(cond > 3):
if(cond > 2):
if(cond > 1):
pass
else:
use(x)
else:
use(x)
else:
use(x)
def use(v):
# this could just be `pass` but we do not want it optimized away.
y = v+2