|
|
@@ -4869,6 +4869,8 @@ wasm_loader_push_frame_offset(WASMLoaderContext *ctx, uint8 type,
|
|
|
bool disable_emit, int16 operand_offset,
|
|
|
char *error_buf, uint32 error_buf_size)
|
|
|
{
|
|
|
+ uint32 cell_num_to_push, i;
|
|
|
+
|
|
|
if (type == VALUE_TYPE_VOID)
|
|
|
return true;
|
|
|
|
|
|
@@ -4893,19 +4895,23 @@ wasm_loader_push_frame_offset(WASMLoaderContext *ctx, uint8 type,
|
|
|
if (is_32bit_type(type))
|
|
|
return true;
|
|
|
|
|
|
- if (ctx->p_code_compiled == NULL) {
|
|
|
- if (!check_offset_push(ctx, error_buf, error_buf_size))
|
|
|
- return false;
|
|
|
- }
|
|
|
+ cell_num_to_push = wasm_value_type_cell_num(type) - 1;
|
|
|
+ for (i = 0; i < cell_num_to_push; i++) {
|
|
|
+ if (ctx->p_code_compiled == NULL) {
|
|
|
+ if (!check_offset_push(ctx, error_buf, error_buf_size))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- ctx->frame_offset++;
|
|
|
- if (!disable_emit) {
|
|
|
- ctx->dynamic_offset++;
|
|
|
- if (ctx->dynamic_offset > ctx->max_dynamic_offset) {
|
|
|
- ctx->max_dynamic_offset = ctx->dynamic_offset;
|
|
|
- bh_assert(ctx->max_dynamic_offset < INT16_MAX);
|
|
|
+ ctx->frame_offset++;
|
|
|
+ if (!disable_emit) {
|
|
|
+ ctx->dynamic_offset++;
|
|
|
+ if (ctx->dynamic_offset > ctx->max_dynamic_offset) {
|
|
|
+ ctx->max_dynamic_offset = ctx->dynamic_offset;
|
|
|
+ bh_assert(ctx->max_dynamic_offset < INT16_MAX);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|