| ... | ... | @@ -17127,6 +17127,7 @@ static IrInstruction *ir_analyze_container_member_access_inner(IrAnalyze *ira, |
| 17127 | 17127 | static IrInstruction *ir_analyze_struct_field_ptr(IrAnalyze *ira, IrInstruction *source_instr, |
| 17128 | 17128 | TypeStructField *field, IrInstruction *struct_ptr, ZigType *struct_type, bool initializing) |
| 17129 | 17129 | { |
| 17130 | Error err; |
| 17130 | 17131 | switch (type_has_one_possible_value(ira->codegen, field->type_entry)) { |
| 17131 | 17132 | case OnePossibleValueInvalid: |
| 17132 | 17133 | return ira->codegen->invalid_instruction; |
| ... | ... | @@ -17137,9 +17138,9 @@ static IrInstruction *ir_analyze_struct_field_ptr(IrAnalyze *ira, IrInstruction |
| 17137 | 17138 | case OnePossibleValueNo: |
| 17138 | 17139 | break; |
| 17139 | 17140 | } |
| 17141 | if ((err = type_resolve(ira->codegen, struct_type, ResolveStatusAlignmentKnown))) |
| 17142 | return ira->codegen->invalid_instruction; |
| 17140 | 17143 | assert(struct_ptr->value.type->id == ZigTypeIdPointer); |
| 17141 | | bool is_packed = (struct_type->data.structure.layout == ContainerLayoutPacked); |
| 17142 | | uint32_t align_bytes = is_packed ? 1 : get_abi_alignment(ira->codegen, field->type_entry); |
| 17143 | 17144 | uint32_t ptr_bit_offset = struct_ptr->value.type->data.pointer.bit_offset_in_host; |
| 17144 | 17145 | uint32_t ptr_host_int_bytes = struct_ptr->value.type->data.pointer.host_int_bytes; |
| 17145 | 17146 | uint32_t host_int_bytes_for_result_type = (ptr_host_int_bytes == 0) ? |
| ... | ... | @@ -17147,7 +17148,7 @@ static IrInstruction *ir_analyze_struct_field_ptr(IrAnalyze *ira, IrInstruction |
| 17147 | 17148 | bool is_const = struct_ptr->value.type->data.pointer.is_const; |
| 17148 | 17149 | bool is_volatile = struct_ptr->value.type->data.pointer.is_volatile; |
| 17149 | 17150 | ZigType *ptr_type = get_pointer_to_type_extra(ira->codegen, field->type_entry, |
| 17150 | | is_const, is_volatile, PtrLenSingle, align_bytes, |
| 17151 | is_const, is_volatile, PtrLenSingle, field->align, |
| 17151 | 17152 | (uint32_t)(ptr_bit_offset + field->bit_offset_in_host), |
| 17152 | 17153 | (uint32_t)host_int_bytes_for_result_type, false); |
| 17153 | 17154 | if (instr_is_comptime(struct_ptr)) { |