2022-03-10 18:56:19 -05:00
|
|
|
// error-pattern: pointer arithmetic failed: null pointer is not a valid pointer
|
2022-06-26 21:26:14 -04:00
|
|
|
// compile-flags: -Zmiri-permissive-provenance
|
2019-11-04 12:11:31 +01:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = 0 as *mut i32;
|
|
|
|
let _x = x.wrapping_offset(8); // ok, this has no inbounds tag
|
|
|
|
let _x = unsafe { x.offset(0) }; // UB despite offset 0, NULL is never inbounds
|
|
|
|
}
|