Skip to content

Commit 87588ca

Browse files
authored
Fix lookup function issue reported in nightly run (#3868)
1 parent bb3f8d9 commit 87588ca

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

core/iwasm/aot/aot_runtime.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,6 +2222,9 @@ aot_lookup_function(const AOTModuleInstance *module_inst, const char *name)
22222222
(AOTFunctionInstance *)module_inst->export_functions;
22232223
AOTFunctionInstance key = { .func_name = (char *)name };
22242224

2225+
if (!export_funcs)
2226+
return NULL;
2227+
22252228
return bsearch(&key, export_funcs, module_inst->export_func_count,
22262229
sizeof(AOTFunctionInstance), cmp_func_inst);
22272230
}

core/iwasm/interpreter/wasm_runtime.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3437,6 +3437,9 @@ wasm_lookup_function(const WASMModuleInstance *module_inst, const char *name)
34373437
WASMExportFuncInstance key = { .name = (char *)name };
34383438
WASMExportFuncInstance *export_func_inst;
34393439

3440+
if (!module_inst->export_functions)
3441+
return NULL;
3442+
34403443
export_func_inst = bsearch(
34413444
&key, module_inst->export_functions, module_inst->export_func_count,
34423445
sizeof(WASMExportFuncInstance), cmp_export_func_inst);

0 commit comments

Comments
 (0)