Re:Semgrep: Semantic grep for code
by SavantIdiot on Thursday April 22, 2021 @01:40PM
(#26905537)
It can infer (x==y) if x=1 and y=1, which is grep cannot do.
[ Parent
| on HN ]
This must surely fail... isn't it equivalent to solving the halting problem? Or does it run the whole program like a debugger?
It fails pretty fast.
import random
y = 0
def f(x):
print(x)
if random.randint(0,1) == 2:
y = 1
f(y)
This not only fails but crashes the program.