#include <program_block.hpp>
|
| | ProgramBlock ()=default |
| |
| void | process_instruction (FuzzInstruction instruction) |
| | process the instruction
|
| |
| void | finalize_with_return (uint8_t return_size, MemoryTagWrapper return_value_tag, uint16_t return_value_offset_index) |
| | finalize the program block with a return instruction Tries to find memory address with the given return_value_tag, if there are no such address (zero variables of such tag are stored), it sets the return address to 0. Sets the terminator type to RETURN.
|
| |
| void | finalize_with_jump (ProgramBlock *target_block, bool copy_memory_manager=true) |
| | finalize the block with a jump Sets the terminator type to JUMP, adds the target block to the successors and the current block to the predecessors.
|
| |
| void | finalize_with_jump_if (ProgramBlock *target_then_block, ProgramBlock *target_else_block, uint16_t condition_offset, bool copy_memory_manager=true) |
| | finalize the block with a jump if Sets the terminator type to JUMP_IF, adds the target blocks to the successors and the current block to the predecessors. Sets the condition offset index.
|
| |
| void | insert_internal_call (ProgramBlock *target_block) |
| | insert INTERNALCALL instruction with 0 offset
|
| |
| std::optional< uint16_t > | get_terminating_condition_value () |
| |
| std::vector< bb::avm2::simulation::Instruction > | get_instructions () |
| |
| bool | is_memory_address_set (uint16_t address) |
| |
| void | patch_internal_calls () |
| | in insert_internal_call we insert INTERNALCALL instruction with 0 offset, because we don't know the resulting block offsets this method patches the INTERNALCALL instructions with the actual offset
|
| |
Definition at line 37 of file program_block.hpp.
◆ ProgramBlock()
| ProgramBlock::ProgramBlock |
( |
| ) |
|
|
default |
◆ finalize_with_jump()
| void ProgramBlock::finalize_with_jump |
( |
ProgramBlock * |
target_block, |
|
|
bool |
copy_memory_manager = true |
|
) |
| |
finalize the block with a jump Sets the terminator type to JUMP, adds the target block to the successors and the current block to the predecessors.
Definition at line 1049 of file program_block.cpp.
◆ finalize_with_jump_if()
| void ProgramBlock::finalize_with_jump_if |
( |
ProgramBlock * |
target_then_block, |
|
|
ProgramBlock * |
target_else_block, |
|
|
uint16_t |
condition_offset, |
|
|
bool |
copy_memory_manager = true |
|
) |
| |
finalize the block with a jump if Sets the terminator type to JUMP_IF, adds the target blocks to the successors and the current block to the predecessors. Sets the condition offset index.
Definition at line 1060 of file program_block.cpp.
◆ finalize_with_return()
| void ProgramBlock::finalize_with_return |
( |
uint8_t |
return_size, |
|
|
MemoryTagWrapper |
return_value_tag, |
|
|
uint16_t |
return_value_offset_index |
|
) |
| |
finalize the program block with a return instruction Tries to find memory address with the given return_value_tag, if there are no such address (zero variables of such tag are stored), it sets the return address to 0. Sets the terminator type to RETURN.
- Note
- if the block has caller, it inserts INTERNALRETURN only
Definition at line 1013 of file program_block.cpp.
◆ get_instructions()
◆ get_terminating_condition_value()
| std::optional< uint16_t > ProgramBlock::get_terminating_condition_value |
( |
| ) |
|
◆ insert_internal_call()
| void ProgramBlock::insert_internal_call |
( |
ProgramBlock * |
target_block | ) |
|
◆ is_memory_address_set()
| bool ProgramBlock::is_memory_address_set |
( |
uint16_t |
address | ) |
|
◆ patch_internal_calls()
| void ProgramBlock::patch_internal_calls |
( |
| ) |
|
in insert_internal_call we insert INTERNALCALL instruction with 0 offset, because we don't know the resulting block offsets this method patches the INTERNALCALL instructions with the actual offset
Definition at line 1090 of file program_block.cpp.
◆ preprocess_memory_addresses() [1/2]
| void ProgramBlock::preprocess_memory_addresses |
( |
AddressRef |
address, |
|
|
uint32_t |
actual_address |
|
) |
| |
|
private |
preprocess the memory addresses Sets M[0] = base_offset for Relative/IndirectRelative modes Sets M[pointer_address] = pointer_value for Indirect/IndirectRelative modes
Definition at line 11 of file program_block.cpp.
◆ preprocess_memory_addresses() [2/2]
| void ProgramBlock::preprocess_memory_addresses |
( |
ResultAddressRef |
address, |
|
|
uint32_t |
actual_address |
|
) |
| |
|
private |
◆ process_add_16_instruction()
◆ process_add_8_instruction()
◆ process_and_16_instruction()
◆ process_and_8_instruction()
◆ process_calldatacopy_instruction()
◆ process_cast_16_instruction()
◆ process_cast_8_instruction()
◆ process_div_16_instruction()
◆ process_div_8_instruction()
◆ process_emitnotehash_instruction()
◆ process_emitnulifier_instruction()
◆ process_eq_16_instruction()
◆ process_eq_8_instruction()
◆ process_fdiv_16_instruction()
◆ process_fdiv_8_instruction()
◆ process_getenvvar_instruction()
◆ process_instruction()
process the instruction
- Parameters
-
| instruction | the instruction to process Updates stored_variables if the instruction writes to memory Updates instructions with the instruction If arguments of the instruction are not in stored_variables, the instruction is skipped |
Definition at line 1119 of file program_block.cpp.
◆ process_lt_16_instruction()
◆ process_lt_8_instruction()
◆ process_lte_16_instruction()
◆ process_lte_8_instruction()
◆ process_mov_16_instruction()
◆ process_mov_8_instruction()
◆ process_mul_16_instruction()
◆ process_mul_8_instruction()
◆ process_not_16_instruction()
◆ process_not_8_instruction()
◆ process_notehashexists_instruction()
◆ process_nullifierexists_instruction()
◆ process_or_16_instruction()
◆ process_or_8_instruction()
◆ process_set_128_instruction()
◆ process_set_16_instruction()
◆ process_set_32_instruction()
◆ process_set_64_instruction()
◆ process_set_8_instruction()
◆ process_set_ff_instruction()
◆ process_shl_16_instruction()
◆ process_shl_8_instruction()
◆ process_shr_16_instruction()
◆ process_shr_8_instruction()
◆ process_sload_instruction()
◆ process_sstore_instruction()
◆ process_sub_16_instruction()
◆ process_sub_8_instruction()
◆ process_xor_16_instruction()
◆ process_xor_8_instruction()
◆ caller
the block that called this block by INTERNALCALL This field is copied to predecessors on every CFG instructions
Definition at line 109 of file program_block.hpp.
◆ condition_offset_index
| uint16_t ProgramBlock::condition_offset_index = 0 |
|
private |
the offset index of the condition variable (for JUMP_IF)
Definition at line 43 of file program_block.hpp.
◆ instructions
◆ internal_call_instruction_indicies_to_patch
| std::map<size_t, ProgramBlock*> ProgramBlock::internal_call_instruction_indicies_to_patch |
|
private |
◆ memory_manager
◆ offset
| int ProgramBlock::offset = -1 |
◆ predecessors
◆ successors
◆ terminator_type
The documentation for this class was generated from the following files: