Sign in
android
/
toolchain
/
rustc
/
refs/heads/rust-1.73.0
/
.
/
src
/
tools
/
miri
/
tests
/
fail
/
dangling_pointers
/
maybe_null_pointer_deref_zst.rs
blob: 73d0b120680133ae5780bc869e6e28a16772008f [
file
] [
log
] [
blame
]
fn
main
()
{
// This pointer *could* be NULL so we cannot load from it, not even at ZST
let
ptr
=
(&
0u8
as
*
const
u8
).
wrapping_sub
(
0x800
)
as
*
const
();
let
_x
:
()
=
unsafe
{
*
ptr
};
//~ ERROR: out-of-bounds
}