@@ -975,9 +975,9 @@ 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 ( ecx : & mut InterpCx < ' mir , ' tcx , Self > , reason : mir :: UnwindTerminateReason ) -> InterpResult < ' tcx > {
979979 // Call the lang item.
980- let panic = ecx. tcx . lang_items ( ) . panic_cannot_unwind ( ) . unwrap ( ) ;
980+ let panic = ecx. tcx . lang_items ( ) . get ( reason . lang_item ( ) ) . unwrap ( ) ;
981981 let panic = ty:: Instance :: mono ( ecx. tcx . tcx , panic) ;
982982 ecx. call_function (
983983 panic,
@@ -1405,4 +1405,22 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
14051405 }
14061406 res
14071407 }
1408+
1409+ fn after_local_allocated (
1410+ ecx : & mut InterpCx < ' mir , ' tcx , Self > ,
1411+ frame : usize ,
1412+ local : mir:: Local ,
1413+ mplace : & MPlaceTy < ' tcx , Provenance >
1414+ ) -> InterpResult < ' tcx > {
1415+ let Some ( Provenance :: Concrete { alloc_id, .. } ) = mplace. ptr . provenance else {
1416+ panic ! ( "after_local_allocated should only be called on fresh allocations" ) ;
1417+ } ;
1418+ let local_decl = & ecx. active_thread_stack ( ) [ frame] . body . local_decls [ local] ;
1419+ let span = local_decl. source_info . span ;
1420+ ecx. machine
1421+ . allocation_spans
1422+ . borrow_mut ( )
1423+ . insert ( alloc_id, ( span, None ) ) ;
1424+ Ok ( ( ) )
1425+ }
14081426}
0 commit comments