@@ -159,8 +159,8 @@ impl Provenance for Tag {
159
159
write ! ( f, "{:?}" , tag. sb)
160
160
}
161
161
162
- fn get_alloc_id ( self ) -> AllocId {
163
- self . alloc_id
162
+ fn get_alloc_id ( self ) -> Option < AllocId > {
163
+ Some ( self . alloc_id )
164
164
}
165
165
}
166
166
@@ -608,21 +608,37 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
608
608
}
609
609
610
610
#[ inline( always) ]
611
- fn ptr_from_addr (
611
+ fn ptr_from_addr_cast (
612
612
ecx : & MiriEvalContext < ' mir , ' tcx > ,
613
613
addr : u64 ,
614
614
) -> Pointer < Option < Self :: PointerTag > > {
615
615
intptrcast:: GlobalStateInner :: ptr_from_addr ( addr, ecx)
616
616
}
617
617
618
+ #[ inline( always) ]
619
+ fn ptr_from_addr_transmute (
620
+ ecx : & MiriEvalContext < ' mir , ' tcx > ,
621
+ addr : u64 ,
622
+ ) -> Pointer < Option < Self :: PointerTag > > {
623
+ Self :: ptr_from_addr_cast ( ecx, addr)
624
+ }
625
+
626
+ #[ inline( always) ]
627
+ fn expose_ptr (
628
+ _ecx : & mut InterpCx < ' mir , ' tcx , Self > ,
629
+ _ptr : Pointer < Self :: PointerTag > ,
630
+ ) -> InterpResult < ' tcx > {
631
+ Ok ( ( ) )
632
+ }
633
+
618
634
/// Convert a pointer with provenance into an allocation-offset pair,
619
635
/// or a `None` with an absolute address if that conversion is not possible.
620
636
fn ptr_get_alloc (
621
637
ecx : & MiriEvalContext < ' mir , ' tcx > ,
622
638
ptr : Pointer < Self :: PointerTag > ,
623
- ) -> ( AllocId , Size , Self :: TagExtra ) {
639
+ ) -> Option < ( AllocId , Size , Self :: TagExtra ) > {
624
640
let rel = intptrcast:: GlobalStateInner :: abs_ptr_to_rel ( ecx, ptr) ;
625
- ( ptr. provenance . alloc_id , rel, ptr. provenance . sb )
641
+ Some ( ( ptr. provenance . alloc_id , rel, ptr. provenance . sb ) )
626
642
}
627
643
628
644
#[ inline( always) ]
0 commit comments