Skip to content

Commit ea27539

Browse files
committed
Fix frame_offset calculation to match actual frame_ref stack changes
1 parent 7898af9 commit ea27539

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

core/iwasm/interpreter/wasm_loader.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12105,14 +12105,13 @@ wasm_loader_prepare_bytecode(WASMModule *module, WASMFunction *func,
1210512105
j--;
1210612106
}
1210712107
#endif
12108-
12108+
uint8 *frame_ref_before_pop = loader_ctx->frame_ref;
1210912109
POP_TYPE(
1211012110
wasm_type->types[wasm_type->param_count - i - 1]);
1211112111
#if WASM_ENABLE_FAST_INTERP != 0
1211212112
/* decrease the frame_offset pointer accordingly to keep
1211312113
* consistent with frame_ref stack */
12114-
cell_num = wasm_value_type_cell_num(
12115-
wasm_type->types[wasm_type->param_count - i - 1]);
12114+
cell_num = frame_ref_before_pop - loader_ctx->frame_ref;
1211612115
loader_ctx->frame_offset -= cell_num;
1211712116

1211812117
if (loader_ctx->frame_offset

0 commit comments

Comments
 (0)