mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-20 04:06:30 +00:00
Moved ctx to be the first argument in emscripten
This commit is contained in:
@ -4,7 +4,7 @@ use std::cell::UnsafeCell;
|
||||
use wasmer_runtime_core::vm::Ctx;
|
||||
|
||||
/// setjmp
|
||||
pub fn __setjmp(env_addr: u32, ctx: &mut Ctx) -> c_int {
|
||||
pub fn __setjmp(ctx: &mut Ctx, env_addr: u32) -> c_int {
|
||||
debug!("emscripten::__setjmp (setjmp)");
|
||||
unsafe {
|
||||
// Rather than using the env as the holder of the jump buffer pointer,
|
||||
@ -15,7 +15,7 @@ pub fn __setjmp(env_addr: u32, ctx: &mut Ctx) -> c_int {
|
||||
let jump_buf: UnsafeCell<[u32; 27]> = UnsafeCell::new([0; 27]);
|
||||
let jumps = &mut get_emscripten_data(ctx).jumps;
|
||||
let result = setjmp(jump_buf.get() as _);
|
||||
// We set the jump index to be the last value of jumps
|
||||
// We set the jump index to be the last 3value of jumps
|
||||
*jump_index = jumps.len() as _;
|
||||
// We hold the reference of the jump buffer
|
||||
jumps.push(jump_buf);
|
||||
@ -25,7 +25,7 @@ pub fn __setjmp(env_addr: u32, ctx: &mut Ctx) -> c_int {
|
||||
|
||||
/// longjmp
|
||||
#[allow(unreachable_code)]
|
||||
pub fn __longjmp(env_addr: u32, val: c_int, ctx: &mut Ctx) {
|
||||
pub fn __longjmp(ctx: &mut Ctx, env_addr: u32, val: c_int) {
|
||||
debug!("emscripten::__longjmp (longmp)");
|
||||
unsafe {
|
||||
// We retrieve the jump index from the env address
|
||||
|
Reference in New Issue
Block a user