Use pre-created exec_env for instantiation and module_malloc/free (#2047)
Use pre-created exec_env for instantiation and module_malloc/free, use the same exec_env of the current thread to avoid potential unexpected behavior. And remove unnecessary shared_mem_lock in wasm_module_free, which may cause dead lock.
This commit is contained in:
@ -225,8 +225,11 @@ wasm_application_execute_main(WASMModuleInstanceCommon *module_inst, int32 argc,
|
||||
ret = wasm_runtime_get_exception(module_inst) == NULL;
|
||||
|
||||
#if WASM_ENABLE_DUMP_CALL_STACK != 0
|
||||
if (!ret)
|
||||
wasm_runtime_dump_call_stack(exec_env);
|
||||
if (!ret) {
|
||||
exec_env = wasm_runtime_get_exec_env_singleton(module_inst);
|
||||
if (exec_env)
|
||||
wasm_runtime_dump_call_stack(exec_env);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user