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> {
390
390
) -> InterpResult < ' tcx , interpret:: Pointer < Provenance > > {
391
391
let this = self . eval_context_ref ( ) ;
392
392
393
- let ( prov, offset) = ptr. into_parts ( ) ; // offset is relative (AllocId provenance)
393
+ let ( prov, offset) = ptr. prov_and_relative_offset ( ) ;
394
394
let alloc_id = prov. alloc_id ( ) ;
395
395
396
396
// Get a pointer to the beginning of this allocation.
@@ -447,7 +447,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
447
447
) -> Option < ( AllocId , Size ) > {
448
448
let this = self . eval_context_ref ( ) ;
449
449
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)
451
451
452
452
let alloc_id = if let Provenance :: Concrete { alloc_id, .. } = tag {
453
453
alloc_id
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ impl interpret::Provenance for Provenance {
285
285
}
286
286
287
287
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
289
289
write ! ( f, "{:#x}" , addr. bytes( ) ) ?;
290
290
if f. alternate ( ) {
291
291
write ! ( f, "{prov:#?}" ) ?;
Original file line number Diff line number Diff line change @@ -68,15 +68,13 @@ impl VisitProvenance for Provenance {
68
68
69
69
impl VisitProvenance for StrictPointer {
70
70
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) ;
73
72
}
74
73
}
75
74
76
75
impl VisitProvenance for Pointer {
77
76
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) ;
80
78
}
81
79
}
82
80
Original file line number Diff line number Diff line change @@ -411,7 +411,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
411
411
AlignFromBytesError :: TooLarge ( _) => Align :: MAX ,
412
412
}
413
413
} ) ;
414
- let ( _ , addr) = ptr. into_parts ( ) ; // we know the offset is absolute
414
+ let addr = ptr. addr ( ) ;
415
415
// Cannot panic since `align` is a power of 2 and hence non-zero.
416
416
if addr. bytes ( ) . strict_rem ( align. bytes ( ) ) != 0 {
417
417
throw_unsup_format ! (
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
49
49
&& matches ! ( & * this. tcx. sess. target. os, "macos" | "solaris" | "illumos" )
50
50
&& ( flags & map_fixed) != 0
51
51
{
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) ) ;
53
53
}
54
54
55
55
let prot_read = this. eval_libc_i32 ( "PROT_READ" ) ;
You can’t perform that action at this time.
0 commit comments