@@ -124,7 +124,7 @@ pub fn create_ecx<'a, 'mir: 'a, 'tcx: 'mir>(
124
124
DUMMY_SP ,
125
125
start_mir,
126
126
Some ( ret_ptr. into ( ) ) ,
127
- StackPopCleanup :: None { cleanup : true } ,
127
+ StackPopCleanup :: None { cleanup : true , unwind : None } ,
128
128
) ?;
129
129
130
130
let mut args = ecx. frame ( ) . mir . args_iter ( ) ;
@@ -375,7 +375,11 @@ pub struct Evaluator<'tcx> {
375
375
376
376
/// Extra information needed for unwinding
377
377
/// This is 'None' when we're running in abort mode
378
- pub ( crate ) cached_data : Option < CachedTypes < ' tcx > >
378
+ pub ( crate ) cached_data : Option < CachedTypes < ' tcx > > ,
379
+
380
+ /// Whether or not we are currently unwinding from
381
+ /// a panic
382
+ pub ( crate ) unwinding : bool
379
383
}
380
384
381
385
pub struct CachedTypes < ' tcx > {
@@ -394,7 +398,8 @@ impl<'tcx> Evaluator<'tcx> {
394
398
tls : TlsData :: default ( ) ,
395
399
validate,
396
400
rng : seed. map ( |s| StdRng :: seed_from_u64 ( s) ) ,
397
- cached_data : None
401
+ cached_data : None ,
402
+ unwinding : false
398
403
}
399
404
}
400
405
}
@@ -503,7 +508,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
503
508
// Don't do anything when we are done. The `statement()` function will increment
504
509
// the old stack frame's stmt counter to the next statement, which means that when
505
510
// `exchange_malloc` returns, we go on evaluating exactly where we want to be.
506
- StackPopCleanup :: None { cleanup : true } ,
511
+ StackPopCleanup :: None { cleanup : true , unwind : None } ,
507
512
) ?;
508
513
509
514
let mut args = ecx. frame ( ) . mir . args_iter ( ) ;
@@ -636,7 +641,8 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
636
641
fn stack_pop (
637
642
ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
638
643
extra : FrameData ,
639
- ) -> EvalResult < ' tcx > {
640
- Ok ( ecx. memory ( ) . extra . borrow_mut ( ) . end_call ( extra. call_id ) )
644
+ ) -> EvalResult < ' tcx , StackPopInfo > {
645
+ ecx. memory ( ) . extra . borrow_mut ( ) . end_call ( extra. call_id ) ;
646
+ Ok ( StackPopInfo { unwinding : ecx. machine . unwinding } )
641
647
}
642
648
}
0 commit comments