Moved ctx to be the first argument in emscripten

This commit is contained in:
Syrus
2019-02-09 13:58:05 -08:00
parent 393b7dbdf3
commit 6c7fd55b87
22 changed files with 209 additions and 209 deletions

View File

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