Files
codeql/python/ql/test/library-tests/essa/ssa-compute/test.py
Rasmus Wriedt Larsen b3f29b0a53 Python: Add failing ESSA use-use test
I initially created this as a dataflow test, but then realized it could
just be an ESSA test. I cound't find any existing ESSA tests though :|
so created a new dir for it.
2022-10-26 17:49:33 +02:00

21 lines
362 B
Python

class X(object):
def foo(self, *args):
print("X.foo", args)
def func(cond=True):
x = X() # $ def=x
print(x) # $ def-use=x:7
y = x # $ def=y use-use=x:9
print(y) # $ def-use=y:11
x.foo() # $ use-use=x:11
x.foo(1 if cond else 0) # $ use-use=x:14
x.foo() # $ MISSING: use-use=x:16
print(x) # $ use-use=x:17
func()