mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
Fix run-pass/signal-exit-status to not trigger UB by writing to NULL.
This commit is contained in:
parent
77d2cd28fd
commit
8341f6451b
@ -18,7 +18,7 @@ pub fn main() {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
if args.len() >= 2 && args[1] == "signal" {
|
||||
// Raise a segfault.
|
||||
unsafe { *(0 as *mut isize) = 0; }
|
||||
unsafe { *(1 as *mut isize) = 0; }
|
||||
} else {
|
||||
let status = Command::new(&args[0]).arg("signal").status().unwrap();
|
||||
assert!(status.code().is_none());
|
||||
|
Loading…
Reference in New Issue
Block a user