Improve miri's error reporting in check_in_alloc
This commit is contained in:
parent
2a738bb8ed
commit
980db98b64
1 changed files with 2 additions and 1 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue