Skip to content

Commit

Permalink
Refactor: enhance C API function import handling in native invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
lum1n0us committed Dec 22, 2024
1 parent a68d9f9 commit cbb33b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/iwasm/aot/aot_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -3563,6 +3563,11 @@ aot_invoke_native(WASMExecEnv *exec_env, uint32 func_idx, uint32 argc,
attachment = import_func->attachment;
if (func_inst->call_conv_wasm_c_api) {
/* from c_api */
c_api_func_import = module_inst->c_api_func_imports
? module_inst->c_api_func_imports + func_idx
: NULL;
bh_assert(c_api_func_import
&& "c_api_func_imports should be set in c_api");
ret = wasm_runtime_invoke_c_api_native(
(WASMModuleInstanceCommon *)module_inst, func_ptr, func_type, argc,
argv, c_api_func_import->with_env_arg, c_api_func_import->env_arg);
Expand Down

0 comments on commit cbb33b4

Please sign in to comment.