From 46ed39ec200a3bd0e402c994203a9d67d62b0c6c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 17 Jul 2021 14:43:23 +0200 Subject: [PATCH] adjust for PointerOutOfBounds change --- src/stacked_borrows.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index ddfbfd42668..e04de65ac3f 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -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 }); } -- 2.44.0