From fbcf8c2c60b32ade99881a0d42c93c13b6911c9c Mon Sep 17 00:00:00 2001 From: Xu Jun Date: Tue, 18 Jul 2023 16:06:21 +0800 Subject: [PATCH] Fix some static scan issues (#2362) --- core/iwasm/interpreter/wasm_loader.c | 9 +++++---- core/iwasm/interpreter/wasm_runtime.c | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/iwasm/interpreter/wasm_loader.c b/core/iwasm/interpreter/wasm_loader.c index 1ce4aab0a..f1a71a8ab 100644 --- a/core/iwasm/interpreter/wasm_loader.c +++ b/core/iwasm/interpreter/wasm_loader.c @@ -7014,6 +7014,7 @@ static bool copy_params_to_dynamic_space(WASMLoaderContext *loader_ctx, bool is_if_block, char *error_buf, uint32 error_buf_size) { + bool ret = false; int16 *frame_offset = NULL; uint8 *cells = NULL, cell; int16 *src_offsets = NULL; @@ -7084,13 +7085,13 @@ copy_params_to_dynamic_space(WASMLoaderContext *loader_ctx, bool is_if_block, if (is_if_block) PUSH_OFFSET_TYPE(VALUE_TYPE_I32); + ret = true; + +fail: /* Free the emit data */ wasm_runtime_free(emit_data); - return true; - -fail: - return false; + return ret; } #endif diff --git a/core/iwasm/interpreter/wasm_runtime.c b/core/iwasm/interpreter/wasm_runtime.c index 5b441dc88..00f0cf668 100644 --- a/core/iwasm/interpreter/wasm_runtime.c +++ b/core/iwasm/interpreter/wasm_runtime.c @@ -1104,10 +1104,14 @@ execute_post_instantiate_functions(WASMModuleInstance *module_inst, goto fail; } +#if WASM_ENABLE_LIBC_WASI != 0 if (initialize_func && !wasm_call_function(exec_env, initialize_func, 0, NULL)) { goto fail; } +#else + (void)initialize_func; +#endif if (post_inst_func && !wasm_call_function(exec_env, post_inst_func, 0, NULL)) {