stage1 修复vm 提供简单参数检查 修复聚合类型bug
This commit is contained in:
@@ -451,11 +451,16 @@ static void parse_for_stmt(spl_comp_t *ctx) {
|
||||
spl_emit(ctx, SPL_PUSH, SPL_U64, elem_byte_size);
|
||||
spl_emit(ctx, SPL_MUL, SPL_U64, 0);
|
||||
spl_emit(ctx, SPL_ADD, SPL_U64, 0);
|
||||
spl_type_t elem_bt = elem_type ? spl_type_emit_type(elem_type) : SPL_I32;
|
||||
spl_emit(ctx, SPL_LOAD, elem_bt, 0);
|
||||
spl_emit(ctx, SPL_LADDR, SPL_PTR, val_offset);
|
||||
spl_emit(ctx, SPL_SWAP, SPL_VOID, 0);
|
||||
spl_emit(ctx, SPL_STORE, elem_bt, 0);
|
||||
if (elem_type && !spl_type_is_scalar(elem_type) &&
|
||||
spl_type_size(elem_type) > sizeof(spl_val_t)) {
|
||||
spl_emit_copy_slots(ctx, val_offset, spl_type_slot_count(elem_type));
|
||||
} else {
|
||||
spl_type_t elem_bt = elem_type ? spl_type_emit_type(elem_type) : SPL_I32;
|
||||
spl_emit(ctx, SPL_LOAD, elem_bt, 0);
|
||||
spl_emit(ctx, SPL_LADDR, SPL_PTR, val_offset);
|
||||
spl_emit(ctx, SPL_SWAP, SPL_VOID, 0);
|
||||
spl_emit(ctx, SPL_STORE, elem_bt, 0);
|
||||
}
|
||||
|
||||
skip_nl(ctx);
|
||||
spl_parse_block(ctx); /* body */
|
||||
|
||||
Reference in New Issue
Block a user