From b75b7f804a34081e92388db231cc768095345e85 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Mon, 1 Aug 2016 21:28:32 -0700 Subject: [PATCH] Use abort() when panicking --- ctru-sys/src/sys/libc.rs | 1 + src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ctru-sys/src/sys/libc.rs b/ctru-sys/src/sys/libc.rs index 95e37db..b4d4a12 100644 --- a/ctru-sys/src/sys/libc.rs +++ b/ctru-sys/src/sys/libc.rs @@ -7,5 +7,6 @@ pub enum c_void { } extern "C" { + pub fn abort() -> !; pub fn write(fd: i32, buf: *const c_void, count: usize) -> isize; } diff --git a/src/lib.rs b/src/lib.rs index 43d72a7..ca5c249 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,5 +20,5 @@ pub use sdmc::Sdmc; extern "C" fn eh_personality() {} #[lang = "panic_fmt"] fn panic_fmt() -> ! { - loop {} + unsafe { libctru::libc::abort() } }