| ... | @@ -17464,7 +17464,12 @@ static IrInstruction *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_ | ... | @@ -17464,7 +17464,12 @@ static IrInstruction *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_ |
| 17464 | return ir_analyze_container_member_access_inner(ira, bare_type, field_name, | 17464 | return ir_analyze_container_member_access_inner(ira, bare_type, field_name, |
| 17465 | source_instr, container_ptr, container_type); | 17465 | source_instr, container_ptr, container_type); |
| 17466 | } | 17466 | } |
| 17467 | ZigType *ptr_type = get_pointer_to_type_extra(ira->codegen, field->type_entry, | 17467 | |
| | 17468 | ZigType *field_type = resolve_union_field_type(ira->codegen, field); |
| | 17469 | if (field_type == nullptr) |
| | 17470 | return ira->codegen->invalid_instruction; |
| | 17471 | |
| | 17472 | ZigType *ptr_type = get_pointer_to_type_extra(ira->codegen, field_type, |
| 17468 | is_const, is_volatile, PtrLenSingle, 0, 0, 0, false); | 17473 | is_const, is_volatile, PtrLenSingle, 0, 0, 0, false); |
| 17469 | if (instr_is_comptime(container_ptr)) { | 17474 | if (instr_is_comptime(container_ptr)) { |
| 17470 | ConstExprValue *ptr_val = ir_resolve_const(ira, container_ptr, UndefBad); | 17475 | ConstExprValue *ptr_val = ir_resolve_const(ira, container_ptr, UndefBad); |
| ... | @@ -17481,7 +17486,7 @@ static IrInstruction *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_ | ... | @@ -17481,7 +17486,7 @@ static IrInstruction *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_ |
| 17481 | if (initializing) { | 17486 | if (initializing) { |
| 17482 | ConstExprValue *payload_val = create_const_vals(1); | 17487 | ConstExprValue *payload_val = create_const_vals(1); |
| 17483 | payload_val->special = ConstValSpecialUndef; | 17488 | payload_val->special = ConstValSpecialUndef; |
| 17484 | payload_val->type = field->type_entry; | 17489 | payload_val->type = field_type; |
| 17485 | payload_val->parent.id = ConstParentIdUnion; | 17490 | payload_val->parent.id = ConstParentIdUnion; |
| 17486 | payload_val->parent.data.p_union.union_val = union_val; | 17491 | payload_val->parent.data.p_union.union_val = union_val; |
| 17487 | | 17492 | |