@@ -26,7 +26,7 @@ use helpers::check_arg_count;
26
26
#[ derive( Debug ) ]
27
27
pub struct CatchUnwindData < ' tcx > {
28
28
/// The `catch_fn` callback to call in case of a panic.
29
- catch_fn : Scalar < Provenance > ,
29
+ catch_fn : Pointer < Option < Provenance > > ,
30
30
/// The `data` argument for that callback.
31
31
data : Scalar < Provenance > ,
32
32
/// The return place from the original call to `try`.
@@ -86,7 +86,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
86
86
let [ try_fn, data, catch_fn] = check_arg_count ( args) ?;
87
87
let try_fn = this. read_pointer ( try_fn) ?;
88
88
let data = this. read_scalar ( data) ?. check_init ( ) ?;
89
- let catch_fn = this. read_scalar ( catch_fn) ? . check_init ( ) ?;
89
+ let catch_fn = this. read_pointer ( catch_fn) ?;
90
90
91
91
// Now we make a function call, and pass `data` as first and only argument.
92
92
let f_instance = this. get_ptr_fn ( try_fn) ?. as_instance ( ) ?;
@@ -140,8 +140,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
140
140
let payload = this. active_thread_mut ( ) . panic_payload . take ( ) . unwrap ( ) ;
141
141
142
142
// Push the `catch_fn` stackframe.
143
- let f_instance =
144
- this. get_ptr_fn ( this. scalar_to_ptr ( catch_unwind. catch_fn ) ?) ?. as_instance ( ) ?;
143
+ let f_instance = this. get_ptr_fn ( catch_unwind. catch_fn ) ?. as_instance ( ) ?;
145
144
trace ! ( "catch_fn: {:?}" , f_instance) ;
146
145
this. call_function (
147
146
f_instance,
0 commit comments