Instruction.backward_df()
Returns a list of all previous instructions/arguments/variables of the current point in the data flow graph.
The backward_df()
function is an intra-procedural analysis function. This means that the function does not operate recursively and instead returns instruction/argument/variable
within the current function instruction set.
The function returns the derived classes from Point, such as ArgumentPoint, VarValue, Instruction, etc.
Query Example
from glider import *
def query():
#fetch an instruction
instructions = Instructions().with_callee_function_name('verify').exec(1)
for points in instructions[0].backward_df():
print(points.source_code())
# return the list of previous instructions of the current instruction
return instructions
Output Example

For the same contract, this query showcases that the return list elements are type-casted from Point:
from glider import *
def query():
#fetch an instruction
instructions = Instructions().with_callee_function_name('verify').exec(1)
for points in instructions[0].backward_df():
if isinstance(points, ArgumentPoint):
print(points.get_variable().name)
print(points.source_code())
# return the list of previous instructions of the current instruction
return instructions

Last updated