2020-03-03 17:04:57 -06:00
|
|
|
// needs-sanitizer-support
|
2020-06-04 19:00:00 -05:00
|
|
|
// needs-sanitizer-address
|
2020-03-03 17:04:57 -06:00
|
|
|
//
|
|
|
|
// compile-flags: -Z sanitizer=address -O
|
|
|
|
//
|
|
|
|
// run-fail
|
|
|
|
// error-pattern: AddressSanitizer: SEGV
|
|
|
|
|
|
|
|
use std::ffi::c_void;
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
fn free(ptr: *mut c_void);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
free(1 as *mut c_void);
|
|
|
|
}
|
|
|
|
}
|