3
3
//! The core pieces of the runtime are:
4
4
//! - An implementation of `__rust_maybe_catch_panic` that pushes the invoked stack frame with
5
5
//! 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
7
7
//! 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
9
9
//! immediately returns, but on the *unwind* edge (not the normal return edge), thus initiating unwinding.
10
10
//! - A hook executed each time a frame is popped, such that if the frame pushed by `__rust_maybe_catch_panic`
11
11
//! gets popped *during unwinding*, we take the panic payload and store it according to the extra
@@ -44,9 +44,9 @@ impl VisitProvenance for CatchUnwindData<'_> {
44
44
45
45
impl < ' mir , ' tcx : ' mir > EvalContextExt < ' mir , ' tcx > for crate :: MiriInterpCx < ' mir , ' tcx > { }
46
46
pub 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
48
48
/// by libpanic_unwind to delegate the actual unwinding process to Miri.
49
- fn handle_miri_start_panic (
49
+ fn handle_miri_start_unwind (
50
50
& mut self ,
51
51
abi : Abi ,
52
52
link_name : Symbol ,
@@ -55,7 +55,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
55
55
) -> InterpResult < ' tcx > {
56
56
let this = self . eval_context_mut ( ) ;
57
57
58
- trace ! ( "miri_start_panic : {:?}" , this. frame( ) . instance) ;
58
+ trace ! ( "miri_start_unwind : {:?}" , this. frame( ) . instance) ;
59
59
60
60
// Get the raw pointer stored in arg[0] (the panic payload).
61
61
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> {
69
69
}
70
70
71
71
/// Handles the `try` intrinsic, the underlying implementation of `std::panicking::try`.
72
- fn handle_try (
72
+ fn handle_catch_unwind (
73
73
& mut self ,
74
74
args : & [ OpTy < ' tcx , Provenance > ] ,
75
75
dest : & PlaceTy < ' tcx , Provenance > ,
@@ -85,7 +85,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
85
85
// what that is), and returns 1.
86
86
// The `payload` is passed (by libstd) to `__rust_panic_cleanup`, which is then expected to
87
87
// 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
89
89
// a pointer to `Box<dyn Any + Send + 'static>`.
90
90
91
91
// Get all the arguments.
@@ -141,7 +141,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
141
141
// We set the return value of `try` to 1, since there was a panic.
142
142
this. write_scalar ( Scalar :: from_i32 ( 1 ) , & catch_unwind. dest ) ?;
143
143
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 `.
145
145
// This is exactly the second argument we need to pass to `catch_fn`.
146
146
let payload = this. active_thread_mut ( ) . panic_payloads . pop ( ) . unwrap ( ) ;
147
147
0 commit comments