This commit is contained in:
Ben Kimock 2023-04-10 07:57:55 -04:00
parent 73702d5e39
commit d50fee9fb2
2 changed files with 10 additions and 14 deletions

View file

@ -157,7 +157,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
&[catch_unwind.data.into(), payload.into()],
None,
// Directly return to caller of `try`.
StackPopCleanup::Goto { ret: Some(catch_unwind.ret), unwind: mir::UnwindAction::Continue },
StackPopCleanup::Goto {
ret: Some(catch_unwind.ret),
unwind: mir::UnwindAction::Continue,
},
)?;
// We pushed a new stack frame, the engine should not do any jumping now!
@ -211,10 +214,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
Abi::Rust,
&[index.into(), len.into()],
None,
StackPopCleanup::Goto {
ret: None,
unwind,
},
StackPopCleanup::Goto { ret: None, unwind },
)?;
}
MisalignedPointerDereference { required, found } => {
@ -235,19 +235,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
Abi::Rust,
&[required.into(), found.into()],
None,
StackPopCleanup::Goto {
ret: None,
unwind,
},
StackPopCleanup::Goto { ret: None, unwind },
)?;
}
_ => {
// Forward everything else to `panic` lang item.
this.start_panic(
msg.description(),
unwind,
)?;
this.start_panic(msg.description(), unwind)?;
}
}
Ok(())

View file

@ -1,3 +1,5 @@
warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best.
thread 'main' panicked at 'explicit panic', $DIR/terminate-terminator.rs:LL:CC
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: abnormal termination: panic in a function that cannot unwind
@ -23,5 +25,5 @@ LL | panic_abort();
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
error: aborting due to previous error
error: aborting due to previous error; 1 warning emitted