Skip to content

Commit 838dd81

Browse files
authored
don't return an uninitialized trap if argv_to_results fails (#3935)
Currently, if argv_to_results fails (e.g. because an unsupported type is encountered), an non-null trap with an uninitialized message is returned.
1 parent e09613c commit 838dd81

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/iwasm/common/wasm_c_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3442,6 +3442,8 @@ wasm_func_call(const wasm_func_t *func, const wasm_val_vec_t *params,
34423442
if (result_count) {
34433443
if (!argv_to_results(argv, wasm_functype_results(func->type),
34443444
results)) {
3445+
wasm_runtime_set_exception(func->inst_comm_rt,
3446+
"argv_to_results failed");
34453447
goto failed;
34463448
}
34473449
results->num_elems = result_count;

0 commit comments

Comments
 (0)