33//! The core pieces of the runtime are:
44//! - An implementation of `__rust_maybe_catch_panic` that pushes the invoked stack frame with
55//! some extra metadata derived from the panic-catching arguments of `__rust_maybe_catch_panic`.
6- //! - A hack in `libpanic_unwind` that calls the `miri_start_panic ` intrinsic instead of the
6+ //! - A hack in `libpanic_unwind` that calls the `miri_start_unwind ` intrinsic instead of the
77//! target-native panic runtime. (This lives in the rustc repo.)
8- //! - An implementation of `miri_start_panic ` that stores its argument (the panic payload), and then
8+ //! - An implementation of `miri_start_unwind ` that stores its argument (the panic payload), and then
99//! immediately returns, but on the *unwind* edge (not the normal return edge), thus initiating unwinding.
1010//! - A hook executed each time a frame is popped, such that if the frame pushed by `__rust_maybe_catch_panic`
1111//! gets popped *during unwinding*, we take the panic payload and store it according to the extra
@@ -44,9 +44,9 @@ impl VisitProvenance for CatchUnwindData<'_> {
4444
4545impl < ' mir , ' tcx : ' mir > EvalContextExt < ' mir , ' tcx > for crate :: MiriInterpCx < ' mir , ' tcx > { }
4646pub trait EvalContextExt < ' mir , ' tcx : ' mir > : crate :: MiriInterpCxExt < ' mir , ' tcx > {
47- /// Handles the special `miri_start_panic ` intrinsic, which is called
47+ /// Handles the special `miri_start_unwind ` intrinsic, which is called
4848 /// by libpanic_unwind to delegate the actual unwinding process to Miri.
49- fn handle_miri_start_panic (
49+ fn handle_miri_start_unwind (
5050 & mut self ,
5151 abi : Abi ,
5252 link_name : Symbol ,
@@ -55,7 +55,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
5555 ) -> InterpResult < ' tcx > {
5656 let this = self . eval_context_mut ( ) ;
5757
58- trace ! ( "miri_start_panic : {:?}" , this. frame( ) . instance) ;
58+ trace ! ( "miri_start_unwind : {:?}" , this. frame( ) . instance) ;
5959
6060 // Get the raw pointer stored in arg[0] (the panic payload).
6161 let [ payload] = this. check_shim ( abi, Abi :: Rust , link_name, args) ?;
@@ -69,7 +69,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
6969 }
7070
7171 /// Handles the `try` intrinsic, the underlying implementation of `std::panicking::try`.
72- fn handle_try (
72+ fn handle_catch_unwind (
7373 & mut self ,
7474 args : & [ OpTy < ' tcx , Provenance > ] ,
7575 dest : & PlaceTy < ' tcx , Provenance > ,
@@ -85,7 +85,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
8585 // what that is), and returns 1.
8686 // The `payload` is passed (by libstd) to `__rust_panic_cleanup`, which is then expected to
8787 // return a `Box<dyn Any + Send + 'static>`.
88- // In Miri, `miri_start_panic ` is passed exactly that type, so we make the `payload` simply
88+ // In Miri, `miri_start_unwind ` is passed exactly that type, so we make the `payload` simply
8989 // a pointer to `Box<dyn Any + Send + 'static>`.
9090
9191 // Get all the arguments.
@@ -141,7 +141,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
141141 // We set the return value of `try` to 1, since there was a panic.
142142 this. write_scalar ( Scalar :: from_i32 ( 1 ) , & catch_unwind. dest ) ?;
143143
144- // The Thread's `panic_payload` holds what was passed to `miri_start_panic `.
144+ // The Thread's `panic_payload` holds what was passed to `miri_start_unwind `.
145145 // This is exactly the second argument we need to pass to `catch_fn`.
146146 let payload = this. active_thread_mut ( ) . panic_payloads . pop ( ) . unwrap ( ) ;
147147
0 commit comments