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-23 20:35:14 +00:00
|
|
|
use wasmer_runtime_core::{vm::Ctx, Instance};
|
2018-12-13 18:28:30 +00:00
|
|
|
|
|
|
|
/// emscripten: ___cxa_allocate_exception
|
2019-01-23 07:27:13 +00:00
|
|
|
pub extern "C" fn ___cxa_allocate_exception(size: u32, vmctx: &mut Ctx) -> u32 {
|
2018-12-13 18:28:30 +00:00
|
|
|
debug!("emscripten::___cxa_allocate_exception");
|
2019-01-23 07:27:13 +00:00
|
|
|
env::call_malloc(size as _, vmctx)
|
2018-12-13 18:28:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// emscripten: ___cxa_throw
|
|
|
|
/// TODO: We don't have support for exceptions yet
|
2019-01-23 07:27:13 +00:00
|
|
|
pub extern "C" fn ___cxa_throw(_ptr: u32, ty: u32, destructor: u32, vmctx: &mut Ctx) {
|
2018-12-13 18:28:30 +00:00
|
|
|
debug!("emscripten::___cxa_throw");
|
2018-12-18 12:44:15 +00:00
|
|
|
_abort();
|
2018-12-13 18:28:30 +00:00
|
|
|
}
|