@@ -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
@@ -604,21 +604,37 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
604
604
}
605
605
606
606
#[ inline( always) ]
607
- fn ptr_from_addr (
607
+ fn ptr_from_addr_cast (
608
608
ecx : & MiriEvalContext < ' mir , ' tcx > ,
609
609
addr : u64 ,
610
610
) -> Pointer < Option < Self :: PointerTag > > {
611
611
intptrcast:: GlobalStateInner :: ptr_from_addr ( addr, ecx)
612
612
}
613
613
614
+ #[ inline( always) ]
615
+ fn ptr_from_addr_transmute (
616
+ ecx : & MiriEvalContext < ' mir , ' tcx > ,
617
+ addr : u64 ,
618
+ ) -> Pointer < Option < Self :: PointerTag > > {
619
+ Self :: ptr_from_addr_cast ( ecx, addr)
620
+ }
621
+
622
+ #[ inline( always) ]
623
+ fn expose_ptr (
624
+ ecx : & mut InterpCx < ' mir , ' tcx , Self > ,
625
+ ptr : Pointer < Self :: PointerTag > ,
626
+ ) -> InterpResult < ' tcx > {
627
+ Ok ( ( ) )
628
+ }
629
+
614
630
/// Convert a pointer with provenance into an allocation-offset pair,
615
631
/// or a `None` with an absolute address if that conversion is not possible.
616
632
fn ptr_get_alloc (
617
633
ecx : & MiriEvalContext < ' mir , ' tcx > ,
618
634
ptr : Pointer < Self :: PointerTag > ,
619
- ) -> ( AllocId , Size , Self :: TagExtra ) {
635
+ ) -> Option < ( AllocId , Size , Self :: TagExtra ) > {
620
636
let rel = intptrcast:: GlobalStateInner :: abs_ptr_to_rel ( ecx, ptr) ;
621
- ( ptr. provenance . alloc_id , rel, ptr. provenance . sb )
637
+ Some ( ( ptr. provenance . alloc_id , rel, ptr. provenance . sb ) )
622
638
}
623
639
624
640
#[ inline( always) ]
0 commit comments