]> git.lizzy.rs Git - rust.git/commitdiff
adjust for PointerOutOfBounds change
authorRalf Jung <post@ralfj.de>
Sat, 17 Jul 2021 12:43:23 +0000 (14:43 +0200)
committerRalf Jung <post@ralfj.de>
Tue, 20 Jul 2021 11:30:49 +0000 (13:30 +0200)
src/stacked_borrows.rs

index ddfbfd426680aaafa45be9eb5b5b6dc0858a3531..e04de65ac3fd58b245e51bd603c9af1bfa69479e 100644 (file)
@@ -623,14 +623,14 @@ fn reborrow(
         let orig_tag = ptr.provenance.sb;
 
         // Ensure we bail out if the pointer goes out-of-bounds (see miri#1050).
-        let (allocation_size, _) =
+        let (alloc_size, _) =
             this.memory.get_size_and_align(alloc_id, AllocCheck::Dereferenceable)?;
-        if base_offset + size > allocation_size {
+        if base_offset + size > alloc_size {
             throw_ub!(PointerOutOfBounds {
                 alloc_id,
-                offset: base_offset,
-                size,
-                allocation_size,
+                alloc_size,
+                ptr_offset: this.machine_usize_to_isize(base_offset.bytes()),
+                ptr_size: size,
                 msg: CheckInAllocMsg::InboundsTest
             });
         }