Fix issues reported by klocwork (#1060)

Fix issues reported by klocwork, fix host_tool compile error,
and update build script of benchmark jetstream
This commit is contained in:
Wenyong Huang
2022-03-24 17:34:22 +08:00
committed by GitHub
parent 7262aebf77
commit 5264ce4118
7 changed files with 31 additions and 13 deletions

View File

@ -1309,7 +1309,8 @@ wasm_runtime_finalize_call_function(WASMExecEnv *exec_env,
bh_assert((argv && ret_argv) || (argc == 0));
if (argv == ret_argv) {
if (argv == ret_argv || argc == 0) {
/* no need to transfrom externref results */
return true;
}
@ -2398,7 +2399,7 @@ wasm_runtime_init_wasi(WASMModuleInstanceCommon *module_inst,
address = strtok(cp, "/");
mask = strtok(NULL, "/");
ret = addr_pool_insert(apool, address, (uint8)(atoi(mask)));
ret = addr_pool_insert(apool, address, (uint8)(mask ? atoi(mask) : 0));
wasm_runtime_free(cp);
if (!ret) {
set_error_buf(error_buf, error_buf_size,