diff options
| author | Fenrir <[email protected]> | 2017-07-31 23:23:20 -0600 |
|---|---|---|
| committer | Fenrir <[email protected]> | 2017-07-31 23:23:20 -0600 |
| commit | 5f0fc0c00148c6128ee9354ba7360b386a59bef5 (patch) | |
| tree | 3fe53b38fa6487a03c8938a1132e0e14f273d430 /ctr-std/src/rt.rs | |
| parent | Merge pull request #41 from FenrirWolf/panic-reboot (diff) | |
| download | archived-ctru-rs-5f0fc0c00148c6128ee9354ba7360b386a59bef5.tar.xz archived-ctru-rs-5f0fc0c00148c6128ee9354ba7360b386a59bef5.zip | |
Add unwinding strategy for panics
Diffstat (limited to 'ctr-std/src/rt.rs')
| -rw-r--r-- | ctr-std/src/rt.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ctr-std/src/rt.rs b/ctr-std/src/rt.rs index 178b5a0..ddfb707 100644 --- a/ctr-std/src/rt.rs +++ b/ctr-std/src/rt.rs @@ -22,6 +22,7 @@ issue = "0")] #![doc(hidden)] +use panic; use mem; // Reexport some of our utilities which are expected by other crates. @@ -31,6 +32,8 @@ pub use panicking::{begin_panic, begin_panic_fmt}; #[lang = "start"] #[allow(unused_variables)] fn lang_start(main: *const u8, argc: isize, argv: *const *const u8) -> isize { - unsafe { mem::transmute::<_, fn()>(main)(); } + let _ = unsafe { + panic::catch_unwind(mem::transmute::<_, fn()>(main)) + }; 0 } |