Skip to content

Commit

Permalink
don't return an uninitialized trap if argv_to_results fails (#3935)
Browse files Browse the repository at this point in the history
Currently, if argv_to_results fails (e.g. because an unsupported type is
encountered), an non-null trap with an uninitialized message is
returned.
  • Loading branch information
sjamesr authored Nov 28, 2024
1 parent e09613c commit 838dd81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/iwasm/common/wasm_c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -3442,6 +3442,8 @@ wasm_func_call(const wasm_func_t *func, const wasm_val_vec_t *params,
if (result_count) {
if (!argv_to_results(argv, wasm_functype_results(func->type),
results)) {
wasm_runtime_set_exception(func->inst_comm_rt,
"argv_to_results failed");
goto failed;
}
results->num_elems = result_count;
Expand Down

0 comments on commit 838dd81

Please sign in to comment.