revm_bytecode::eof::verification

Function validate_eof_code

Source
pub fn validate_eof_code(
    code: &[u8],
    data_size: usize,
    this_types_index: usize,
    num_of_containers: usize,
    types: &[TypesSection],
    tracker: &mut AccessTracker,
) -> Result<(), EofValidationError>
Expand description

Validates that:

  • All instructions are valid.
  • It ends with a terminating instruction or RJUMP.
  • All instructions are accessed by forward jumps or .

Validate stack requirements and if all codes sections are used.