Skip to content

Commit

Permalink
Improve miri's error reporting in check_in_alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
LooMaclin committed Apr 8, 2019
1 parent 2a738bb commit 980db98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc/mir/interpret/allocation.rs
Expand Up @@ -378,7 +378,8 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
where Extra: AllocationExtra<Tag, MemoryExtra>
{
// get_bytes_unchecked tests relocation edges
let bytes = self.get_bytes_with_undef_and_ptr(cx, ptr, size, CheckInAllocMsg::PointerArithmetic)?;
let bytes = self.get_bytes_with_undef_and_ptr(cx, ptr, size,
CheckInAllocMsg::PointerArithmetic)?;
// Undef check happens *after* we established that the alignment is correct.
// We must not return Ok() for unaligned pointers!
if self.check_defined(ptr, size).is_err() {
Expand Down

0 comments on commit 980db98

Please sign in to comment.