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:
@ -322,7 +322,8 @@ wasm_engine_new()
|
||||
singleton_engine =
|
||||
wasm_engine_new_internal(Alloc_With_System_Allocator, NULL);
|
||||
}
|
||||
singleton_engine->ref_count++;
|
||||
if (singleton_engine)
|
||||
singleton_engine->ref_count++;
|
||||
return singleton_engine;
|
||||
}
|
||||
|
||||
@ -339,7 +340,8 @@ wasm_engine_new_with_args(mem_alloc_type_t type, const MemAllocOption *opts)
|
||||
if (!singleton_engine) {
|
||||
singleton_engine = wasm_engine_new_internal(type, opts);
|
||||
}
|
||||
singleton_engine->ref_count++;
|
||||
if (singleton_engine)
|
||||
singleton_engine->ref_count++;
|
||||
return singleton_engine;
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user