소스 검색

[bugfix] initialize "module->retain_function" for wasm_mini_loader (#1333)

Before resolving the module function's export in wasm_mini_loader,
"module->retain_function" need to be initialized, otherwise,
the "__new" function export will lead to abort.

issue: https://github.com/bytecodealliance/wasm-micro-runtime/issues/1332

Co-authored-by: yaozhongxiao <yaozhongxiao@bytedance.com>
yaozhongxiao 3 년 전
부모
커밋
efc8bc10a9
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      core/iwasm/interpreter/wasm_mini_loader.c

+ 1 - 0
core/iwasm/interpreter/wasm_mini_loader.c

@@ -1988,6 +1988,7 @@ load_from_sections(WASMModule *module, WASMSection *sections,
 
     module->malloc_function = (uint32)-1;
     module->free_function = (uint32)-1;
+    module->retain_function = (uint32)-1;
 
     /* Resolve malloc/free function exported by wasm module */
     export = module->exports;