Fix for in enum type

This commit is contained in:
gingerBill
2020-11-26 10:19:45 +00:00
parent 89cceb910a
commit c77098a91c
2 changed files with 2 additions and 2 deletions

View File

@@ -10104,7 +10104,7 @@ void ir_build_range_enum(irProcedure *proc, Type *enum_type, Type *val_type, irV
irValue *max_count = ir_const_int(enum_count);
irValue *ti = ir_type_info(proc, t);
irValue *variant = ir_emit_struct_ep(proc, ti, 3);
irValue *variant = ir_emit_struct_ep(proc, ti, 4);
irValue *eti_ptr = ir_emit_conv(proc, variant, t_type_info_enum_ptr);
irValue *values = ir_emit_load(proc, ir_emit_struct_ep(proc, eti_ptr, 2));
irValue *values_data = ir_slice_elem(proc, values);

View File

@@ -3528,7 +3528,7 @@ void lb_build_range_enum(lbProcedure *p, Type *enum_type, Type *val_type, lbValu
lbValue max_count = lb_const_int(m, t_int, enum_count);
lbValue ti = lb_type_info(m, t);
lbValue variant = lb_emit_struct_ep(p, ti, 3);
lbValue variant = lb_emit_struct_ep(p, ti, 4);
lbValue eti_ptr = lb_emit_conv(p, variant, t_type_info_enum_ptr);
lbValue values = lb_emit_load(p, lb_emit_struct_ep(p, eti_ptr, 2));
lbValue values_data = lb_slice_elem(p, values);