resume_to_exception_handler

Function resume_to_exception_handler 

Source
pub unsafe fn resume_to_exception_handler(
    pc: usize,
    sp: usize,
    fp: usize,
    payload1: usize,
    payload2: usize,
) -> !
Expand description

Resume execution at the given PC, SP, and FP, with the given payload values, according to the tail-call ABI’s exception scheme. Note that this scheme does not restore any other registers, so the given state is all that we need.

§Safety

This method requires:

  • the sp and fp to correspond to an active stack frame (above the current function), in code using Cranelift’s tail calling convention.

  • The pc to correspond to a try_call handler destination, as emitted in Cranelift metadata, or otherwise a target that is expecting the tail-call ABI’s exception ABI.

  • The Rust frames between the unwind destination and this frame to be unwind-safe: that is, they cannot have Drop handlers for which safety requires that they run.