mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-30 09:01:33 +00:00
Updated compatibility with latest emscripten
This commit is contained in:
@ -24,7 +24,7 @@ pub fn is_emscripten_module(module: &Module) -> bool {
|
||||
.namespace_table
|
||||
.get(import_name.namespace_index);
|
||||
let field = module.info().name_table.get(import_name.name_index);
|
||||
if field == "_emscripten_memcpy_big" && namespace == "env" {
|
||||
if (field == "_emscripten_memcpy_big" || field=="emscripten_memcpy_big") && namespace == "env" {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -110,6 +110,8 @@ pub unsafe fn copy_cstr_into_wasm(ctx: &mut Ctx, cstr: *const c_char) -> u32 {
|
||||
pub unsafe fn allocate_on_stack<'a, T: Copy>(ctx: &'a mut Ctx, count: u32) -> (u32, &'a mut [T]) {
|
||||
let offset = get_emscripten_data(ctx)
|
||||
.stack_alloc
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.call(count * (size_of::<T>() as u32))
|
||||
.unwrap();
|
||||
let addr = emscripten_memory_pointer!(ctx.memory(0), offset) as *mut T;
|
||||
|
Reference in New Issue
Block a user