Fix dynamic offset in BR for block with return type (#3192)

The issue was reported in https://github.com/bytecodealliance/wasm-micro-runtime/issues/3170.
This commit is contained in:
Xu Jun
2024-03-01 10:15:17 +08:00
committed by GitHub
parent 5635244169
commit 21819fcff6
2 changed files with 2 additions and 3 deletions

View File

@ -9028,6 +9028,7 @@ 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;