mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
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.
21 lines
362 B
Python
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()
|