File tree Expand file tree Collapse file tree 5 files changed +7
-9
lines changed Expand file tree Collapse file tree 5 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
390390 ) -> InterpResult < ' tcx , interpret:: Pointer < Provenance > > {
391391 let this = self . eval_context_ref ( ) ;
392392
393- let ( prov, offset) = ptr. into_parts ( ) ; // offset is relative (AllocId provenance)
393+ let ( prov, offset) = ptr. prov_and_relative_offset ( ) ;
394394 let alloc_id = prov. alloc_id ( ) ;
395395
396396 // Get a pointer to the beginning of this allocation.
@@ -447,7 +447,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
447447 ) -> Option < ( AllocId , Size ) > {
448448 let this = self . eval_context_ref ( ) ;
449449
450- let ( tag, addr) = ptr. into_parts ( ) ; // addr is absolute (Tag provenance)
450+ let ( tag, addr) = ptr. into_raw_parts ( ) ; // addr is absolute (Miri provenance)
451451
452452 let alloc_id = if let Provenance :: Concrete { alloc_id, .. } = tag {
453453 alloc_id
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ impl interpret::Provenance for Provenance {
285285 }
286286
287287 fn fmt ( ptr : & interpret:: Pointer < Self > , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
288- let ( prov, addr) = ptr. into_parts ( ) ; // address is absolute
288+ let ( prov, addr) = ptr. into_raw_parts ( ) ; // offset is absolute address
289289 write ! ( f, "{:#x}" , addr. bytes( ) ) ?;
290290 if f. alternate ( ) {
291291 write ! ( f, "{prov:#?}" ) ?;
Original file line number Diff line number Diff line change @@ -68,15 +68,13 @@ impl VisitProvenance for Provenance {
6868
6969impl VisitProvenance for StrictPointer {
7070 fn visit_provenance ( & self , visit : & mut VisitWith < ' _ > ) {
71- let ( prov, _offset) = self . into_parts ( ) ;
72- prov. visit_provenance ( visit) ;
71+ self . provenance . visit_provenance ( visit) ;
7372 }
7473}
7574
7675impl VisitProvenance for Pointer {
7776 fn visit_provenance ( & self , visit : & mut VisitWith < ' _ > ) {
78- let ( prov, _offset) = self . into_parts ( ) ;
79- prov. visit_provenance ( visit) ;
77+ self . provenance . visit_provenance ( visit) ;
8078 }
8179}
8280
Original file line number Diff line number Diff line change @@ -411,7 +411,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
411411 AlignFromBytesError :: TooLarge ( _) => Align :: MAX ,
412412 }
413413 } ) ;
414- let ( _ , addr) = ptr. into_parts ( ) ; // we know the offset is absolute
414+ let addr = ptr. addr ( ) ;
415415 // Cannot panic since `align` is a power of 2 and hence non-zero.
416416 if addr. bytes ( ) . strict_rem ( align. bytes ( ) ) != 0 {
417417 throw_unsup_format ! (
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
4949 && matches ! ( & * this. tcx. sess. target. os, "macos" | "solaris" | "illumos" )
5050 && ( flags & map_fixed) != 0
5151 {
52- return interp_ok ( Scalar :: from_maybe_pointer ( Pointer :: from_addr_invalid ( addr) , this) ) ;
52+ return interp_ok ( Scalar :: from_maybe_pointer ( Pointer :: without_provenance ( addr) , this) ) ;
5353 }
5454
5555 let prot_read = this. eval_libc_i32 ( "PROT_READ" ) ;
You can’t perform that action at this time.
0 commit comments