Skip to content

Commit 92426ef

Browse files
committed
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.
1 parent 4e83686 commit 92426ef

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)