Skip to main content

Module unwind

Module unwind 

Source
Expand description

Unwinding runtime for Miri.

The core pieces of the runtime are:

  • An implementation of catch_unwind that pushes the invoked stack frame with some extra metadata derived from the panic-catching arguments of catch_unwind.
  • A hack in libpanic_unwind that calls the miri_start_unwind intrinsic instead of the target-native panic runtime. (This lives in the rustc repo.)
  • An implementation of miri_start_unwind that stores its argument (the panic payload), and then immediately returns, but on the unwind edge (not the normal return edge), thus initiating unwinding.
  • A hook executed each time a frame is popped, such that if the frame pushed by catch_unwind gets popped during unwinding, we take the panic payload and store it according to the extra metadata we remembered when pushing said frame.

Re-exportsยง

use rustc_abi::ExternAbi; ๐Ÿ”’
use rustc_middle::mir; ๐Ÿ”’
use rustc_target::spec::PanicStrategy; ๐Ÿ”’
use crate::*; ๐Ÿ”’

Structsยง

CatchUnwindData
Holds all of the relevant data for when unwinding hits a try frame.

Traitsยง

EvalContextExt