Instruction.previous_instructions()
Returns a list of the previous instructions of the current node in the control flow graph.
previous_instructions() →
APISet
[
Instruction
]
The difference between the previous_instructions() function and previous_instruction() is that this function will return all previous instructions of the current instruction in the CFG (control-flow-graph).
The function is intra-procedural, and thus will not follow function calls; for the inter-procedural variant of this function, use extended_previous_instructions().
For example, in the function:
for the instruction:
the function will return the instructions:
Query Example
Example Output
As can be seen from the last output, "virtual" instructions like entry-point instruction, end-if, etc. when being printed with source_code() will print full code block's source
The function returns APISet, instead of APIList, in case the result of the function is used as the return value of the query it must be casted to list()
Last updated