Fix issues detected by Coverity (#1776)

- wasm_func_call always return trap if failed
- in Debug, always run LEAK_TEST in samples/wasm-c-api
This commit is contained in:
liang.he
2022-12-01 22:03:09 +08:00
committed by GitHub
parent 1652f22a77
commit fc8f70cfa4
14 changed files with 143 additions and 66 deletions

View File

@ -85,8 +85,10 @@ run(void *args_abs)
// Call.
wasm_val_vec_t empty = WASM_EMPTY_VEC;
if (wasm_func_call(run_func, &empty, &empty)) {
wasm_trap_t *trap = wasm_func_call(run_func, &empty, &empty);
if (trap) {
printf("> Error calling function!\n");
wasm_trap_delete(trap);
return NULL;
}