Skip to content

Commit

Permalink
Fix loader small bug (bytecodealliance#3928)
Browse files Browse the repository at this point in the history
  • Loading branch information
TianlongLiang authored Nov 26, 2024
1 parent b0c6d5c commit 1d111a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -9855,7 +9855,12 @@ reserve_block_ret(WASMLoaderContext *loader_ctx, uint8 opcode,
else {
loader_ctx->frame_offset = frame_offset;
loader_ctx->dynamic_offset = dynamic_offset;
PUSH_OFFSET_TYPE(return_types[i]);
if (!(wasm_loader_push_frame_offset(
loader_ctx, return_types[i], disable_emit,
operand_offset, error_buf, error_buf_size))) {
wasm_runtime_free(emit_data);
goto fail;
}
wasm_loader_emit_backspace(loader_ctx, sizeof(int16));
loader_ctx->frame_offset = frame_offset_org;
loader_ctx->dynamic_offset = dynamic_offset_org;
Expand Down
7 changes: 6 additions & 1 deletion core/iwasm/interpreter/wasm_mini_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -5561,7 +5561,12 @@ reserve_block_ret(WASMLoaderContext *loader_ctx, uint8 opcode,
else {
loader_ctx->frame_offset = frame_offset;
loader_ctx->dynamic_offset = dynamic_offset;
PUSH_OFFSET_TYPE(return_types[i]);
if (!(wasm_loader_push_frame_offset(
loader_ctx, return_types[i], disable_emit,
operand_offset, error_buf, error_buf_size))) {
wasm_runtime_free(emit_data);
goto fail;
}
wasm_loader_emit_backspace(loader_ctx, sizeof(int16));
loader_ctx->frame_offset = frame_offset_org;
loader_ctx->dynamic_offset = dynamic_offset_org;
Expand Down

0 comments on commit 1d111a3

Please sign in to comment.