rename panic_paylods → unwind_payloads

This commit is contained in:
Ralf Jung 2025-07-06 16:51:14 +02:00
parent b2d8c81f7f
commit e40f8b26ad
2 changed files with 7 additions and 7 deletions

View file

@ -186,15 +186,15 @@ pub struct Thread<'tcx> {
/// The join status.
join_status: ThreadJoinStatus,
/// Stack of active panic payloads for the current thread. Used for storing
/// the argument of the call to `miri_start_unwind` (the panic payload) when unwinding.
/// Stack of active unwind payloads for the current thread. Used for storing
/// the argument of the call to `miri_start_unwind` (the payload) when unwinding.
/// This is pointer-sized, and matches the `Payload` type in `src/libpanic_unwind/miri.rs`.
///
/// In real unwinding, the payload gets passed as an argument to the landing pad,
/// which then forwards it to 'Resume'. However this argument is implicit in MIR,
/// so we have to store it out-of-band. When there are multiple active unwinds,
/// the innermost one is always caught first, so we can store them as a stack.
pub(crate) panic_payloads: Vec<ImmTy<'tcx>>,
pub(crate) unwind_payloads: Vec<ImmTy<'tcx>>,
/// Last OS error location in memory. It is a 32-bit integer.
pub(crate) last_error: Option<MPlaceTy<'tcx>>,
@ -282,7 +282,7 @@ impl<'tcx> Thread<'tcx> {
stack: Vec::new(),
top_user_relevant_frame: None,
join_status: ThreadJoinStatus::Joinable,
panic_payloads: Vec::new(),
unwind_payloads: Vec::new(),
last_error: None,
on_stack_empty,
}
@ -292,7 +292,7 @@ impl<'tcx> Thread<'tcx> {
impl VisitProvenance for Thread<'_> {
fn visit_provenance(&self, visit: &mut VisitWith<'_>) {
let Thread {
panic_payloads: panic_payload,
unwind_payloads: panic_payload,
last_error,
stack,
top_user_relevant_frame: _,

View file

@ -51,7 +51,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
let payload = this.read_immediate(payload)?;
let thread = this.active_thread_mut();
thread.panic_payloads.push(payload);
thread.unwind_payloads.push(payload);
interp_ok(())
}
@ -132,7 +132,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
// The Thread's `panic_payload` holds what was passed to `miri_start_unwind`.
// This is exactly the second argument we need to pass to `catch_fn`.
let payload = this.active_thread_mut().panic_payloads.pop().unwrap();
let payload = this.active_thread_mut().unwind_payloads.pop().unwrap();
// Push the `catch_fn` stackframe.
let f_instance = this.get_ptr_fn(catch_unwind.catch_fn)?.as_instance()?;