diff --git a/src/apis/emscripten/tests/is_emscripten_true.wast b/src/apis/emscripten/tests/is_emscripten_true.wast index 2499e09da..f04e27cfc 100644 --- a/src/apis/emscripten/tests/is_emscripten_true.wast +++ b/src/apis/emscripten/tests/is_emscripten_true.wast @@ -1,6 +1,7 @@ (module (type $FUNCSIG$ii (func (param i32) (result i32))) (import "env" "puts" (func $puts (param i32) (result i32))) + (import "env" "_emscripten_memcpy_big" (func $_emscripten_memcpy_big (param i32 i32 i32) (result i32))) (table 0 anyfunc) (memory $0 1) (data (i32.const 16) "hello, world!\00") diff --git a/src/apis/emscripten/utils.rs b/src/apis/emscripten/utils.rs index 22a9d199e..7e12c11e2 100644 --- a/src/apis/emscripten/utils.rs +++ b/src/apis/emscripten/utils.rs @@ -8,8 +8,8 @@ use std::slice; /// We check if a provided module is an Emscripten generated one pub fn is_emscripten_module(module: &Module) -> bool { - for (module, _field) in &module.info.imported_funcs { - if module == "env" { + for (module, field) in &module.info.imported_funcs { + if field == "_emscripten_memcpy_big" && module == "env" { return true; } }