diff options
| author | bors <bors@rust-lang.org> | 2013-12-30 20:46:49 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-12-30 20:46:49 -0800 |
| commit | b88138a3ec4bb142fa514a863b62f955bf1c44e3 (patch) | |
| tree | f1e89e5c143f9ab62dcb00073a837d95b7e04fce /src/libstd/rt | |
| parent | a1d3cc53860b1e2377e489333e1f41dec6132b10 (diff) | |
| parent | 705f472c5509ec3a8fe3448541282eca1386344a (diff) | |
| download | rust-b88138a3ec4bb142fa514a863b62f955bf1c44e3.tar.gz rust-b88138a3ec4bb142fa514a863b62f955bf1c44e3.zip | |
auto merge of #11231 : brson/rust/rust_fail, r=alexcrichton
Closes #11219
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/unwind.rs | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index 9706dbae4c6..358df7260f4 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -180,22 +180,29 @@ impl Unwinder { self.unwinding = true; self.cause = Some(cause); - unsafe { - let exception = ~uw::_Unwind_Exception { - exception_class: rust_exception_class(), - exception_cleanup: exception_cleanup, - private_1: 0, - private_2: 0 - }; - let error = uw::_Unwind_RaiseException(cast::transmute(exception)); - rtabort!("Could not unwind stack, error = {}", error as int) - } + rust_fail(); - extern "C" fn exception_cleanup(_unwind_code: uw::_Unwind_Reason_Code, - exception: *uw::_Unwind_Exception) { - rtdebug!("exception_cleanup()"); + // An uninlined, unmangled function upon which to slap yer breakpoints + #[inline(never)] + #[no_mangle] + fn rust_fail() -> ! { unsafe { - let _: ~uw::_Unwind_Exception = cast::transmute(exception); + let exception = ~uw::_Unwind_Exception { + exception_class: rust_exception_class(), + exception_cleanup: exception_cleanup, + private_1: 0, + private_2: 0 + }; + let error = uw::_Unwind_RaiseException(cast::transmute(exception)); + rtabort!("Could not unwind stack, error = {}", error as int) + } + + extern "C" fn exception_cleanup(_unwind_code: uw::_Unwind_Reason_Code, + exception: *uw::_Unwind_Exception) { + rtdebug!("exception_cleanup()"); + unsafe { + let _: ~uw::_Unwind_Exception = cast::transmute(exception); + } } } } |
