From 3c038c0505a5f937aba9a4c3208fe8e0aebdd370 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 27 Sep 2016 21:25:52 +0000 Subject: [PATCH] Document emscripten's unwind impl and remove unused function --- src/libpanic_unwind/emcc.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libpanic_unwind/emcc.rs b/src/libpanic_unwind/emcc.rs index 598f99ba27b..b3ab1117674 100644 --- a/src/libpanic_unwind/emcc.rs +++ b/src/libpanic_unwind/emcc.rs @@ -8,6 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +//! Unwinding for emscripten +//! +//! Whereas Rust's usual unwinding implementation for Unix platforms +//! calls into the libunwind APIs directly, on emscripten we instead +//! call into the C++ unwinding APIs. This is just an expedience since +//! emscripten's runtime always implements those APIs and does not +//! implement libunwind. + #![allow(private_no_mangle_fns)] use core::any::Any; @@ -55,12 +63,6 @@ unsafe extern "C" fn rust_eh_personality(version: c_int, context) } -#[lang = "eh_unwind_resume"] -#[unwind] -unsafe extern "C" fn rust_eh_unwind_resume(panic_ctx: *mut u8) -> ! { - uw::_Unwind_Resume(panic_ctx as *mut uw::_Unwind_Exception); -} - extern { fn __cxa_allocate_exception(thrown_size: libc::size_t) -> *mut libc::c_void; fn __cxa_free_exception(thrown_exception: *mut libc::c_void);