@@ -975,9 +975,12 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
975975 ecx. start_panic_nounwind ( msg)
976976 }
977977
978- fn unwind_terminate ( ecx : & mut InterpCx < ' mir , ' tcx , Self > ) -> InterpResult < ' tcx > {
978+ fn unwind_terminate (
979+ ecx : & mut InterpCx < ' mir , ' tcx , Self > ,
980+ reason : mir:: UnwindTerminateReason ,
981+ ) -> InterpResult < ' tcx > {
979982 // Call the lang item.
980- let panic = ecx. tcx . lang_items ( ) . panic_cannot_unwind ( ) . unwrap ( ) ;
983+ let panic = ecx. tcx . lang_items ( ) . get ( reason . lang_item ( ) ) . unwrap ( ) ;
981984 let panic = ty:: Instance :: mono ( ecx. tcx . tcx , panic) ;
982985 ecx. call_function (
983986 panic,
@@ -1405,4 +1408,19 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
14051408 }
14061409 res
14071410 }
1411+
1412+ fn after_local_allocated (
1413+ ecx : & mut InterpCx < ' mir , ' tcx , Self > ,
1414+ frame : usize ,
1415+ local : mir:: Local ,
1416+ mplace : & MPlaceTy < ' tcx , Provenance > ,
1417+ ) -> InterpResult < ' tcx > {
1418+ let Some ( Provenance :: Concrete { alloc_id, .. } ) = mplace. ptr . provenance else {
1419+ panic ! ( "after_local_allocated should only be called on fresh allocations" ) ;
1420+ } ;
1421+ let local_decl = & ecx. active_thread_stack ( ) [ frame] . body . local_decls [ local] ;
1422+ let span = local_decl. source_info . span ;
1423+ ecx. machine . allocation_spans . borrow_mut ( ) . insert ( alloc_id, ( span, None ) ) ;
1424+ Ok ( ( ) )
1425+ }
14081426}
0 commit comments