Skip to content

Commit 8341f64

Browse files
committed
Fix run-pass/signal-exit-status to not trigger UB by writing to NULL.
1 parent 77d2cd2 commit 8341f64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/run-pass/signal-exit-status.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn main() {
1818
let args: Vec<String> = env::args().collect();
1919
if args.len() >= 2 && args[1] == "signal" {
2020
// Raise a segfault.
21-
unsafe { *(0 as *mut isize) = 0; }
21+
unsafe { *(1 as *mut isize) = 0; }
2222
} else {
2323
let status = Command::new(&args[0]).arg("signal").status().unwrap();
2424
assert!(status.code().is_none());

0 commit comments

Comments
 (0)