Sign in
fuchsia
/
third_party
/
rust
/
ebf574fb97e8a771972ba5866bf395ecce3d14be
/
.
/
src
/
tools
/
miri
/
tests
/
fail-dep
/
realloc-zero.rs
blob: 1482798e90c086f5ae0ff079ac3b22f26ba92011 [
file
] [
log
] [
blame
]
//@ignore-target-windows: No libc on Windows
fn
main
()
{
unsafe
{
let
p1
=
libc
::
malloc
(
20
);
// C made this UB...
let
p2
=
libc
::
realloc
(
p1
,
0
);
//~ERROR: `realloc` with a size of zero
assert
!(
p2
.
is_null
());
}
}