2019-01-10 21:37:59 -08:00
|
|
|
use super::env;
|
2019-01-18 00:18:13 -06:00
|
|
|
use super::process::_abort;
|
2019-01-24 00:00:38 -06:00
|
|
|
use wasmer_runtime_core::vm::Ctx;
|
2018-12-13 19:28:30 +01:00
|
|
|
|
|
|
|
/// emscripten: ___cxa_allocate_exception
|
2019-02-09 13:58:05 -08:00
|
|
|
pub fn ___cxa_allocate_exception(ctx: &mut Ctx, size: u32) -> u32 {
|
2018-12-13 19:28:30 +01:00
|
|
|
debug!("emscripten::___cxa_allocate_exception");
|
2019-02-09 13:58:05 -08:00
|
|
|
env::call_malloc(ctx, size as _)
|
2018-12-13 19:28:30 +01:00
|
|
|
}
|
|
|
|
|
2019-05-28 09:39:49 +02:00
|
|
|
pub fn ___cxa_current_primary_exception(_ctx: &mut Ctx) -> u32 {
|
|
|
|
debug!("emscripten::___cxa_current_primary_exception");
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn ___cxa_decrement_exception_refcount(_ctx: &mut Ctx, _a: u32) {
|
|
|
|
debug!("emscripten::___cxa_decrement_exception_refcount({})", _a);
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn ___cxa_increment_exception_refcount(_ctx: &mut Ctx, _a: u32) {
|
|
|
|
debug!("emscripten::___cxa_increment_exception_refcount({})", _a);
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn ___cxa_rethrow_primary_exception(_ctx: &mut Ctx, _a: u32) {
|
|
|
|
debug!("emscripten::___cxa_rethrow_primary_exception({})", _a);
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
|
2018-12-13 19:28:30 +01:00
|
|
|
/// emscripten: ___cxa_throw
|
|
|
|
/// TODO: We don't have support for exceptions yet
|
2019-02-09 13:58:05 -08:00
|
|
|
pub fn ___cxa_throw(ctx: &mut Ctx, _ptr: u32, _ty: u32, _destructor: u32) {
|
2018-12-13 19:28:30 +01:00
|
|
|
debug!("emscripten::___cxa_throw");
|
2019-01-31 14:48:29 -08:00
|
|
|
_abort(ctx);
|
2018-12-13 19:28:30 +01:00
|
|
|
}
|
2019-03-29 13:42:13 -07: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");
|
|
|
|
}
|
2019-04-05 10:04:39 -07:00
|
|
|
|
|
|
|
pub fn ___cxa_uncaught_exception(_ctx: &mut Ctx) -> i32 {
|
|
|
|
debug!("emscripten::___cxa_uncaught_exception");
|
|
|
|
-1
|
|
|
|
}
|
2019-04-30 11:47:03 -07:00
|
|
|
|
|
|
|
pub fn ___cxa_pure_virtual(_ctx: &mut Ctx) {
|
|
|
|
debug!("emscripten::___cxa_pure_virtual");
|
|
|
|
// ABORT = true
|
|
|
|
panic!("Pure virtual function called!");
|
|
|
|
}
|