Fix some issues reported by Coverity (#1150)

module_wasm_app.c: add return value check for wasm_runtime_call_wasm
aot_runtime.c: add return value check for aot_get_default_memory
aot_runtime.c: add return value check before calling wasm app malloc/free func
wasm_runtime_common.c: fix dead code warning in wasm_runtime_load_from_sections
aot_emit_memory.c: fix potential integer overflow issue
wasm_runtime.c: remove dead code in memory_instantiate, add assertion for globals
samples simple/gui/littlevgl: fix fields of struct sigaction initialization issue
host-tool: add return value check for sendto
This commit is contained in:
Wenyong Huang
2022-05-07 16:51:43 +08:00
committed by GitHub
parent d62543c99c
commit 2bac6a42a7
10 changed files with 41 additions and 33 deletions

View File

@ -827,26 +827,28 @@ wasm_runtime_load_from_sections(WASMSection *section_list, bool is_aot,
{
WASMModuleCommon *module_common;
#if WASM_ENABLE_INTERP != 0
if (!is_aot) {
#if WASM_ENABLE_INTERP != 0
module_common = (WASMModuleCommon *)wasm_load_from_sections(
section_list, error_buf, error_buf_size);
return register_module_with_null_name(module_common, error_buf,
error_buf_size);
}
#endif
}
else {
#if WASM_ENABLE_AOT != 0
if (is_aot) {
module_common = (WASMModuleCommon *)aot_load_from_sections(
section_list, error_buf, error_buf_size);
return register_module_with_null_name(module_common, error_buf,
error_buf_size);
}
#endif
}
#if WASM_ENABLE_INTERP == 0 || WASM_ENABLE_AOT == 0
set_error_buf(error_buf, error_buf_size,
"WASM module load failed: invalid section list type");
return NULL;
#endif
}
void