CodeQL library for Python
codeql/python-all 2.2.1-dev (changelog, source)
Search

Member predicate PhiFunction::getShortCircuitInput

Gets the variable which is the common and complete input to all pi-nodes that are themselves inputs to this phi-node. For example:

x = y()
if complicated_test(x):
    do_a()
else:
    do_b()
phi

Which gives us the ESSA form: x0 = y() x1 = pi(x0, complicated_test(x0)) x2 = pi(x0, not complicated_test(x0)) x3 = phi(x1, x2) However we may not be able to track the value of x through compilated_test meaning that we cannot track x from x0 to x3. By using getShortCircuitInput() we can do so, since the short-circuit input of x3 is x0.

EssaVariable getShortCircuitInput()