pub fn get_previous_frame_pointer(frame_pointer: raw_ptr) -> raw_ptr 
Expand description

Get a pointer to the previous (relative to the frame_pointer parameter) call frame using offsets from a pointer.

Additional Information

More information on data from call frames can be found in the Fuel Specs.
https://docs.fuel.network/docs/specs/fuel-vm/#call-frames

Arguments

  • frame_pointer: [raw_ptr] - The call frame reference directly before the returned call frame pointer.

Returns

  • [raw_ptr] - The memory location of the previous call frame data.

Examples

use std::{call_frames::get_previous_frame_pointer, registers::frame_ptr};

fn foo() {
    let current_call_frame = frame_ptr();
    let previous_call_frame = get_previous_frame_pointer(current_call_frame);
    assert(!previous_call_frame.is_null());
}