@@ -56,7 +56,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
56
56
interp_ok ( ( ) )
57
57
}
58
58
59
- /// Handles the `try ` intrinsic, the underlying implementation of `std::panicking::try` .
59
+ /// Handles the `catch_unwind ` intrinsic.
60
60
fn handle_catch_unwind (
61
61
& mut self ,
62
62
args : & [ OpTy < ' tcx > ] ,
@@ -66,7 +66,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
66
66
let this = self . eval_context_mut ( ) ;
67
67
68
68
// Signature:
69
- // fn r#try (try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32
69
+ // fn catch_unwind (try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32
70
70
// Calls `try_fn` with `data` as argument. If that executes normally, returns 0.
71
71
// If that unwinds, calls `catch_fn` with the first argument being `data` and
72
72
// then second argument being a target-dependent `payload` (i.e. it is up to us to define
@@ -120,14 +120,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
120
120
// We only care about `catch_panic` if we're unwinding - if we're doing a normal
121
121
// return, then we don't need to do anything special.
122
122
if let ( true , Some ( catch_unwind) ) = ( unwinding, extra. catch_unwind . take ( ) ) {
123
- // We've just popped a frame that was pushed by `try `,
123
+ // We've just popped a frame that was pushed by `catch_unwind `,
124
124
// and we are unwinding, so we should catch that.
125
125
trace ! (
126
126
"unwinding: found catch_panic frame during unwinding: {:?}" ,
127
127
this. frame( ) . instance( )
128
128
) ;
129
129
130
- // We set the return value of `try ` to 1, since there was a panic.
130
+ // We set the return value of `catch_unwind ` to 1, since there was a panic.
131
131
this. write_scalar ( Scalar :: from_i32 ( 1 ) , & catch_unwind. dest ) ?;
132
132
133
133
// The Thread's `panic_payload` holds what was passed to `miri_start_unwind`.
@@ -142,7 +142,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
142
142
ExternAbi :: Rust ,
143
143
& [ catch_unwind. data , payload] ,
144
144
None ,
145
- // Directly return to caller of `try `.
145
+ // Directly return to caller of `catch_unwind `.
146
146
StackPopCleanup :: Goto {
147
147
ret : catch_unwind. ret ,
148
148
// `catch_fn` must not unwind.
0 commit comments