Skip to content

Commit ad5d912

Browse files
authored
Rollup merge of #154837 - moturus:motor-os-abort, r=jhpratt
library: std: motor: use OS' process::exit in abort_internal abort_internal() is used in panics; if it calls core::intrinsics::abort(), the process triggers an invalid op code (on x86_64), which is a much harder "abort" than a user-controlled exit via a panic. Most other OSes don't use core::intrinsics::abort() here, but either libc::abort(), or a native OS abort/exit API.
2 parents be79ad6 + 92426ef commit ad5d912

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • library/std/src/sys/pal/motor

library/std/src/sys/pal/motor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ pub fn unsupported_err() -> io::Error {
4242
}
4343

4444
pub fn abort_internal() -> ! {
45-
core::intrinsics::abort();
45+
moto_rt::process::exit(-1)
4646
}

0 commit comments

Comments
 (0)