Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some static scan issues #2362

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions core/iwasm/interpreter/wasm_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down