@@ -158,8 +158,8 @@ impl Provenance for Tag {
158
158
write ! ( f, "{:?}" , tag. sb)
159
159
}
160
160
161
- fn get_alloc_id ( self ) -> AllocId {
162
- self . alloc_id
161
+ fn get_alloc_id ( self ) -> Option < AllocId > {
162
+ Some ( self . alloc_id )
163
163
}
164
164
}
165
165
@@ -600,21 +600,37 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
600
600
}
601
601
602
602
#[ inline( always) ]
603
- fn ptr_from_addr (
603
+ fn ptr_from_addr_cast (
604
604
ecx : & MiriEvalContext < ' mir , ' tcx > ,
605
605
addr : u64 ,
606
606
) -> Pointer < Option < Self :: PointerTag > > {
607
607
intptrcast:: GlobalStateInner :: ptr_from_addr ( addr, ecx)
608
608
}
609
609
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
+
610
626
/// Convert a pointer with provenance into an allocation-offset pair,
611
627
/// or a `None` with an absolute address if that conversion is not possible.
612
628
fn ptr_get_alloc (
613
629
ecx : & MiriEvalContext < ' mir , ' tcx > ,
614
630
ptr : Pointer < Self :: PointerTag > ,
615
- ) -> ( AllocId , Size , Self :: TagExtra ) {
631
+ ) -> Option < ( AllocId , Size , Self :: TagExtra ) > {
616
632
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 ) )
618
634
}
619
635
620
636
#[ inline( always) ]
0 commit comments