| ... | @@ -11202,15 +11202,11 @@ static TypeTableEntry *ir_analyze_instruction_switch_var(IrAnalyze *ira, IrInstr | ... | @@ -11202,15 +11202,11 @@ static TypeTableEntry *ir_analyze_instruction_switch_var(IrAnalyze *ira, IrInstr |
| 11202 | return ira->codegen->builtin_types.entry_invalid; | 11202 | return ira->codegen->builtin_types.entry_invalid; |
| 11203 | | 11203 | |
| 11204 | ConstExprValue *pointee_val = const_ptr_pointee(ira->codegen, target_val_ptr); | 11204 | ConstExprValue *pointee_val = const_ptr_pointee(ira->codegen, target_val_ptr); |
| 11205 | if (pointee_val->type->id == TypeTableEntryIdEnum) { | 11205 | ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base); |
| 11206 | ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base); | 11206 | out_val->data.x_ptr.special = ConstPtrSpecialRef; |
| 11207 | out_val->data.x_ptr.special = ConstPtrSpecialRef; | 11207 | out_val->data.x_ptr.mut = target_val_ptr->data.x_ptr.mut; |
| 11208 | out_val->data.x_ptr.data.ref.pointee = pointee_val->data.x_enum.payload; | 11208 | out_val->data.x_ptr.data.ref.pointee = pointee_val->data.x_enum.payload; |
| 11209 | return get_pointer_to_type(ira->codegen, pointee_val->type, | 11209 | return get_pointer_to_type(ira->codegen, field->type_entry, target_val_ptr->type->data.pointer.is_const); |
| 11210 | target_value_ptr->value.type->data.pointer.is_const); | | |
| 11211 | } else { | | |
| 11212 | zig_panic("TODO comptime switch var"); | | |
| 11213 | } | | |
| 11214 | } | 11210 | } |
| 11215 | | 11211 | |
| 11216 | ir_build_enum_field_ptr_from(&ira->new_irb, &instruction->base, target_value_ptr, field); | 11212 | ir_build_enum_field_ptr_from(&ira->new_irb, &instruction->base, target_value_ptr, field); |