Skip to content

Commit 980db98

Browse files
committed
Improve miri's error reporting in check_in_alloc
1 parent 2a738bb commit 980db98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc/mir/interpret/allocation.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
378378
where Extra: AllocationExtra<Tag, MemoryExtra>
379379
{
380380
// get_bytes_unchecked tests relocation edges
381-
let bytes = self.get_bytes_with_undef_and_ptr(cx, ptr, size, CheckInAllocMsg::PointerArithmetic)?;
381+
let bytes = self.get_bytes_with_undef_and_ptr(cx, ptr, size,
382+
CheckInAllocMsg::PointerArithmetic)?;
382383
// Undef check happens *after* we established that the alignment is correct.
383384
// We must not return Ok() for unaligned pointers!
384385
if self.check_defined(ptr, size).is_err() {

0 commit comments

Comments
 (0)