mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
Ensure we never consider the null pointer dereferencable
This commit is contained in:
parent
512a328e2f
commit
0b781b04cb
@ -441,6 +441,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||||||
msg,
|
msg,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// Ensure we never consider the null pointer dereferencable.
|
||||||
|
if M::PointerTag::OFFSET_IS_ADDR {
|
||||||
|
assert_ne!(ptr.addr(), Size::ZERO);
|
||||||
|
}
|
||||||
// Test align. Check this last; if both bounds and alignment are violated
|
// Test align. Check this last; if both bounds and alignment are violated
|
||||||
// we want the error to be about the bounds.
|
// we want the error to be about the bounds.
|
||||||
if let Some(align) = align {
|
if let Some(align) = align {
|
||||||
|
Loading…
Reference in New Issue
Block a user