Improve miri's error reporting in check_in_alloc

This commit is contained in:
LooMaclin 2019-04-09 00:01:08 +03:00
parent 2a738bb8ed
commit 980db98b64

View file

@ -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() {