Skip to content

Commit

Permalink
fix: stub c++ exception handling for wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Apr 27, 2024
1 parent 05bc4fb commit 8ae23f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ mod emscripten_shims {
let c = str::from_utf8_unchecked(slice::from_raw_parts(str, len));
tracing::error!("Emscripten error: {c}");
}

// despite disabling exceptions literally everywhere when compiling, we still have to stub this...
#[no_mangle]
pub unsafe extern "C" fn __cxa_throw(_ptr: *const (), _type: *const (), _destructor: *const ()) -> ! {
std::process::abort();
}
}

#[no_mangle]
Expand Down

0 comments on commit 8ae23f2

Please sign in to comment.