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.
This commit is contained in:
James Ring 2024-11-27 19:50:44 -08:00 committed by GitHub
parent e09613c722
commit 838dd81e68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;