mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-09-05 17:32:26 +00:00
add comments about AOT crash when calling unlinked import func (#4559)
This commit is contained in:
parent
be3f1f88fe
commit
b0dae624a1
|
@ -1385,6 +1385,16 @@ init_func_ptrs(AOTModuleInstance *module_inst, AOTModule *module,
|
||||||
if (!*func_ptrs) {
|
if (!*func_ptrs) {
|
||||||
const char *module_name = module->import_funcs[i].module_name;
|
const char *module_name = module->import_funcs[i].module_name;
|
||||||
const char *field_name = module->import_funcs[i].func_name;
|
const char *field_name = module->import_funcs[i].func_name;
|
||||||
|
|
||||||
|
/* AOT mode: If linking an imported function fails, we only issue
|
||||||
|
* a warning here instead of throwing an error. However, during the
|
||||||
|
* subsequent `invoke_native` stage, calling this unresolved import
|
||||||
|
* will likely crash.
|
||||||
|
*
|
||||||
|
* See:
|
||||||
|
* https://github.com/bytecodealliance/wasm-micro-runtime/issues/4539
|
||||||
|
*
|
||||||
|
* Debugging: Check if the import is resolved at link time */
|
||||||
LOG_WARNING("warning: failed to link import function (%s, %s)",
|
LOG_WARNING("warning: failed to link import function (%s, %s)",
|
||||||
module_name, field_name);
|
module_name, field_name);
|
||||||
}
|
}
|
||||||
|
@ -2460,6 +2470,14 @@ invoke_native_with_hw_bound_check(WASMExecEnv *exec_env, void *func_ptr,
|
||||||
|
|
||||||
wasm_exec_env_push_jmpbuf(exec_env, &jmpbuf_node);
|
wasm_exec_env_push_jmpbuf(exec_env, &jmpbuf_node);
|
||||||
|
|
||||||
|
/* In AOT mode, this is primarily a design choice for performance reasons.
|
||||||
|
* Before invoke_native, we do not check whether every imported caller is
|
||||||
|
* NULL, unlike wasm_interp_call_func_import() and
|
||||||
|
* wasm_interp_call_func_native().
|
||||||
|
*
|
||||||
|
* See: https://github.com/bytecodealliance/wasm-micro-runtime/issues/4539
|
||||||
|
*/
|
||||||
|
|
||||||
if (os_setjmp(jmpbuf_node.jmpbuf) == 0) {
|
if (os_setjmp(jmpbuf_node.jmpbuf) == 0) {
|
||||||
#if WASM_ENABLE_QUICK_AOT_ENTRY != 0
|
#if WASM_ENABLE_QUICK_AOT_ENTRY != 0
|
||||||
/* Quick call if the quick aot entry is registered */
|
/* Quick call if the quick aot entry is registered */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user