This commit is contained in:
The Miri Conjob Bot 2023-08-26 05:34:03 +00:00
parent e09f743d38
commit ec91a2361b

View File

@ -975,7 +975,10 @@ fn panic_nounwind(ecx: &mut InterpCx<'mir, 'tcx, Self>, msg: &str) -> InterpResu
ecx.start_panic_nounwind(msg) ecx.start_panic_nounwind(msg)
} }
fn unwind_terminate(ecx: &mut InterpCx<'mir, 'tcx, Self>, reason: mir::UnwindTerminateReason) -> InterpResult<'tcx> { fn unwind_terminate(
ecx: &mut InterpCx<'mir, 'tcx, Self>,
reason: mir::UnwindTerminateReason,
) -> InterpResult<'tcx> {
// Call the lang item. // Call the lang item.
let panic = ecx.tcx.lang_items().get(reason.lang_item()).unwrap(); let panic = ecx.tcx.lang_items().get(reason.lang_item()).unwrap();
let panic = ty::Instance::mono(ecx.tcx.tcx, panic); let panic = ty::Instance::mono(ecx.tcx.tcx, panic);
@ -1410,17 +1413,14 @@ fn after_local_allocated(
ecx: &mut InterpCx<'mir, 'tcx, Self>, ecx: &mut InterpCx<'mir, 'tcx, Self>,
frame: usize, frame: usize,
local: mir::Local, local: mir::Local,
mplace: &MPlaceTy<'tcx, Provenance> mplace: &MPlaceTy<'tcx, Provenance>,
) -> InterpResult<'tcx> { ) -> InterpResult<'tcx> {
let Some(Provenance::Concrete { alloc_id, .. }) = mplace.ptr.provenance else { let Some(Provenance::Concrete { alloc_id, .. }) = mplace.ptr.provenance else {
panic!("after_local_allocated should only be called on fresh allocations"); panic!("after_local_allocated should only be called on fresh allocations");
}; };
let local_decl = &ecx.active_thread_stack()[frame].body.local_decls[local]; let local_decl = &ecx.active_thread_stack()[frame].body.local_decls[local];
let span = local_decl.source_info.span; let span = local_decl.source_info.span;
ecx.machine ecx.machine.allocation_spans.borrow_mut().insert(alloc_id, (span, None));
.allocation_spans
.borrow_mut()
.insert(alloc_id, (span, None));
Ok(()) Ok(())
} }
} }