Improve miri's error reporting in check_in_alloc

This commit is contained in:
LooMaclin 2019-04-09 00:42:45 +03:00
parent e5b6fab576
commit 11464e714a

View file

@ -252,7 +252,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
Scalar::Ptr(ptr) => {
// check this is not NULL -- which we can ensure only if this is in-bounds
// of some (potentially dead) allocation.
let align = self.check_bounds_ptr(ptr, InboundsCheck::MaybeDead, CheckInAllocMsg::NullPointer)?;
let align = self.check_bounds_ptr(ptr, InboundsCheck::MaybeDead,
CheckInAllocMsg::NullPointer)?;
(ptr.offset.bytes(), align)
}
Scalar::Bits { bits, size } => {