Skip to content

Commit 9f17ede

Browse files
committed
Raise an aborting signal without UB
1 parent 67540ec commit 9f17ede

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/ui/process/signal-exit-status.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
// ignore-windows
55
// ignore-fuchsia code returned as ZX_TASK_RETCODE_EXCEPTION_KILL, FIXME (#58590)
66

7+
#![feature(core_intrinsics)]
8+
79
use std::env;
810
use std::process::Command;
911

1012
pub fn main() {
1113
let args: Vec<String> = env::args().collect();
1214
if args.len() >= 2 && args[1] == "signal" {
13-
// Raise a segfault.
14-
unsafe { *(1 as *mut isize) = 0; }
15+
// Raise an aborting signal without UB
16+
core::intrinsics::abort();
1517
} else {
1618
let status = Command::new(&args[0]).arg("signal").status().unwrap();
1719
assert!(status.code().is_none());

0 commit comments

Comments
 (0)