Skip to content

Commit 46ed39e

Browse files
committed
adjust for PointerOutOfBounds change
1 parent 37974e6 commit 46ed39e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/stacked_borrows.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,14 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
623623
let orig_tag = ptr.provenance.sb;
624624

625625
// Ensure we bail out if the pointer goes out-of-bounds (see miri#1050).
626-
let (allocation_size, _) =
626+
let (alloc_size, _) =
627627
this.memory.get_size_and_align(alloc_id, AllocCheck::Dereferenceable)?;
628-
if base_offset + size > allocation_size {
628+
if base_offset + size > alloc_size {
629629
throw_ub!(PointerOutOfBounds {
630630
alloc_id,
631-
offset: base_offset,
632-
size,
633-
allocation_size,
631+
alloc_size,
632+
ptr_offset: this.machine_usize_to_isize(base_offset.bytes()),
633+
ptr_size: size,
634634
msg: CheckInAllocMsg::InboundsTest
635635
});
636636
}

0 commit comments

Comments
 (0)