@@ -158,8 +158,8 @@ impl Provenance for Tag {
158158 write ! ( f, "{:?}" , tag. sb)
159159 }
160160
161- fn get_alloc_id ( self ) -> AllocId {
162- self . alloc_id
161+ fn get_alloc_id ( self ) -> Option < AllocId > {
162+ Some ( self . alloc_id )
163163 }
164164}
165165
@@ -600,21 +600,37 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
600600 }
601601
602602 #[ inline( always) ]
603- fn ptr_from_addr (
603+ fn ptr_from_addr_cast (
604604 ecx : & MiriEvalContext < ' mir , ' tcx > ,
605605 addr : u64 ,
606606 ) -> Pointer < Option < Self :: PointerTag > > {
607607 intptrcast:: GlobalStateInner :: ptr_from_addr ( addr, ecx)
608608 }
609609
610+ #[ inline( always) ]
611+ fn ptr_from_addr_transmute (
612+ ecx : & MiriEvalContext < ' mir , ' tcx > ,
613+ addr : u64 ,
614+ ) -> Pointer < Option < Self :: PointerTag > > {
615+ Self :: ptr_from_addr_cast ( ecx, addr)
616+ }
617+
618+ #[ inline( always) ]
619+ fn expose_ptr (
620+ ecx : & mut InterpCx < ' mir , ' tcx , Self > ,
621+ ptr : Pointer < Self :: PointerTag > ,
622+ ) -> InterpResult < ' tcx > {
623+ Ok ( ( ) )
624+ }
625+
610626 /// Convert a pointer with provenance into an allocation-offset pair,
611627 /// or a `None` with an absolute address if that conversion is not possible.
612628 fn ptr_get_alloc (
613629 ecx : & MiriEvalContext < ' mir , ' tcx > ,
614630 ptr : Pointer < Self :: PointerTag > ,
615- ) -> ( AllocId , Size , Self :: TagExtra ) {
631+ ) -> Option < ( AllocId , Size , Self :: TagExtra ) > {
616632 let rel = intptrcast:: GlobalStateInner :: abs_ptr_to_rel ( ecx, ptr) ;
617- ( ptr. provenance . alloc_id , rel, ptr. provenance . sb )
633+ Some ( ( ptr. provenance . alloc_id , rel, ptr. provenance . sb ) )
618634 }
619635
620636 #[ inline( always) ]
0 commit comments