[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>
This commit is contained in:
yaozhongxiao 2022-07-27 18:01:20 +08:00 committed by GitHub
parent ab752cd5c3
commit efc8bc10a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;