mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-17 19:01:20 +00:00
Isolated emscripten in new lib
This commit is contained in:
16
lib/emscripten/src/exception.rs
Normal file
16
lib/emscripten/src/exception.rs
Normal file
@ -0,0 +1,16 @@
|
||||
use super::process::_abort;
|
||||
use super::env;
|
||||
use wasmer_runtime::Instance;
|
||||
|
||||
/// emscripten: ___cxa_allocate_exception
|
||||
pub extern "C" fn ___cxa_allocate_exception(size: u32, instance: &mut Instance) -> u32 {
|
||||
debug!("emscripten::___cxa_allocate_exception");
|
||||
env::call_malloc(size as _, instance)
|
||||
}
|
||||
|
||||
/// emscripten: ___cxa_throw
|
||||
/// TODO: We don't have support for exceptions yet
|
||||
pub extern "C" fn ___cxa_throw(ptr: u32, ty: u32, destructor: u32, instance: &mut Instance) {
|
||||
debug!("emscripten::___cxa_throw");
|
||||
_abort();
|
||||
}
|
Reference in New Issue
Block a user