mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
I ported the predicates showing difference between points-to and type-tracking, since it's helpful to see the list of differences, instead of having to parse expectations!
27 lines
502 B
Python
27 lines
502 B
Python
import sys
|
|
import random
|
|
|
|
# hmm, annoying that you have to keep names unique across files :|
|
|
# since I like to use foo and bar ALL the time :D
|
|
|
|
def rd_foo():
|
|
print('rd_foo')
|
|
|
|
def rd_bar():
|
|
print('rd_bar')
|
|
|
|
if len(sys.argv) >= 2 and not sys.argv[1] in ['0', 'False', 'false']:
|
|
func = rd_foo
|
|
else:
|
|
func = rd_bar
|
|
|
|
func() # $ pt=rd_foo pt=rd_bar
|
|
|
|
# Random doesn't work with points-to :O
|
|
if random.random() < 0.5:
|
|
func2 = rd_foo
|
|
else:
|
|
func2 = rd_bar
|
|
|
|
func2() # $ pt=rd_foo pt=rd_bar
|