@@ -124,7 +124,7 @@ pub fn create_ecx<'a, 'mir: 'a, 'tcx: 'mir>(
124124 DUMMY_SP ,
125125 start_mir,
126126 Some ( ret_ptr. into ( ) ) ,
127- StackPopCleanup :: None { cleanup : true } ,
127+ StackPopCleanup :: None { cleanup : true , unwind : None } ,
128128 ) ?;
129129
130130 let mut args = ecx. frame ( ) . mir . args_iter ( ) ;
@@ -375,7 +375,11 @@ pub struct Evaluator<'tcx> {
375375
376376 /// Extra information needed for unwinding
377377 /// 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
379383}
380384
381385pub struct CachedTypes < ' tcx > {
@@ -394,7 +398,8 @@ impl<'tcx> Evaluator<'tcx> {
394398 tls : TlsData :: default ( ) ,
395399 validate,
396400 rng : seed. map ( |s| StdRng :: seed_from_u64 ( s) ) ,
397- cached_data : None
401+ cached_data : None ,
402+ unwinding : false
398403 }
399404 }
400405}
@@ -503,7 +508,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
503508 // Don't do anything when we are done. The `statement()` function will increment
504509 // the old stack frame's stmt counter to the next statement, which means that when
505510 // `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 } ,
507512 ) ?;
508513
509514 let mut args = ecx. frame ( ) . mir . args_iter ( ) ;
@@ -636,7 +641,8 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
636641 fn stack_pop (
637642 ecx : & mut InterpretCx < ' a , ' mir , ' tcx , Self > ,
638643 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 } )
641647 }
642648}
0 commit comments