loader: Remove updating ctx->dynamic_offset in emit_br_info (#3259)

Should not update `ctx->dynamic_offset` in emit_br_info, since the `Part e` only
sets the dst offsets, the operand stack should not be changed, e.g., the stack
operands are to be used by the opcodes followed by `br_if` opcode.

Reported in https://github.com/bytecodealliance/wasm-micro-runtime/issues/3210.
This commit is contained in:
Wenyong Huang 2024-03-28 16:07:02 +08:00 committed by GitHub
parent 89f4982123
commit f933d4c829
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 2 deletions

View File

@ -8907,7 +8907,6 @@ wasm_loader_emit_br_info(WASMLoaderContext *ctx, BranchBlock *frame_csp,
/* Part e */
dynamic_offset =
frame_csp->dynamic_offset + wasm_get_cell_num(types, arity);
ctx->dynamic_offset = dynamic_offset;
for (i = (int32)arity - 1; i >= 0; i--) {
cell = (uint8)wasm_value_type_cell_num(types[i]);
dynamic_offset -= cell;

View File

@ -4698,7 +4698,6 @@ wasm_loader_emit_br_info(WASMLoaderContext *ctx, BranchBlock *frame_csp,
/* Part e */
dynamic_offset =
frame_csp->dynamic_offset + wasm_get_cell_num(types, arity);
ctx->dynamic_offset = dynamic_offset;
for (i = (int32)arity - 1; i >= 0; i--) {
cell = (uint8)wasm_value_type_cell_num(types[i]);
dynamic_offset -= cell;