2019-01-11 05:37:59 +00:00
|
|
|
use super::env;
|
2019-01-18 06:18:13 +00:00
|
|
|
use super::process::_abort;
|
2019-01-24 06:00:38 +00:00
|
|
|
use wasmer_runtime_core::vm::Ctx;
|
2018-12-13 18:28:30 +00:00
|
|
|
|
|
|
|
/// emscripten: ___cxa_allocate_exception
|
2019-02-09 21:58:05 +00:00
|
|
|
pub fn ___cxa_allocate_exception(ctx: &mut Ctx, size: u32) -> u32 {
|
2018-12-13 18:28:30 +00:00
|
|
|
debug!("emscripten::___cxa_allocate_exception");
|
2019-02-09 21:58:05 +00:00
|
|
|
env::call_malloc(ctx, size as _)
|
2018-12-13 18:28:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// emscripten: ___cxa_throw
|
|
|
|
/// TODO: We don't have support for exceptions yet
|
2019-02-09 21:58:05 +00:00
|
|
|
pub fn ___cxa_throw(ctx: &mut Ctx, _ptr: u32, _ty: u32, _destructor: u32) {
|
2018-12-13 18:28:30 +00:00
|
|
|
debug!("emscripten::___cxa_throw");
|
2019-01-31 22:48:29 +00:00
|
|
|
_abort(ctx);
|
2018-12-13 18:28:30 +00:00
|
|
|
}
|
2019-03-29 20:42:13 +00:00
|
|
|
|
|
|
|
pub fn ___cxa_begin_catch(_ctx: &mut Ctx, _exception_object_ptr: u32) -> i32 {
|
|
|
|
debug!("emscripten::___cxa_begin_catch");
|
|
|
|
-1
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn ___cxa_end_catch(_ctx: &mut Ctx) {
|
|
|
|
debug!("emscripten::___cxa_end_catch");
|
|
|
|
}
|