Make emscripten work again

This commit is contained in:
Syrus
2019-01-24 13:04:12 -08:00
parent c745d38a39
commit fc1b255d40
16 changed files with 297 additions and 290 deletions

View File

@ -3,14 +3,14 @@ use super::process::_abort;
use wasmer_runtime_core::vm::Ctx;
/// emscripten: ___cxa_allocate_exception
pub extern "C" fn ___cxa_allocate_exception(size: u32, vmctx: &mut Ctx) -> u32 {
pub extern "C" fn ___cxa_allocate_exception(size: u32, ctx: &mut Ctx) -> u32 {
debug!("emscripten::___cxa_allocate_exception");
env::call_malloc(size as _, vmctx)
env::call_malloc(size as _, ctx)
}
/// emscripten: ___cxa_throw
/// TODO: We don't have support for exceptions yet
pub extern "C" fn ___cxa_throw(_ptr: u32, _ty: u32, _destructor: u32, _vmctx: &mut Ctx) {
pub extern "C" fn ___cxa_throw(_ptr: u32, _ty: u32, _destructor: u32, _ctx: &mut Ctx) {
debug!("emscripten::___cxa_throw");
_abort();
}