| ... | @@ -17394,11 +17394,23 @@ static IrInstruction *ir_resolve_result_raw(IrAnalyze *ira, IrInstruction *suspe | ... | @@ -17394,11 +17394,23 @@ static IrInstruction *ir_resolve_result_raw(IrAnalyze *ira, IrInstruction *suspe |
| 17394 | } | 17394 | } |
| 17395 | ZigType *parent_ptr_type = parent_result_loc->value->type; | 17395 | ZigType *parent_ptr_type = parent_result_loc->value->type; |
| 17396 | assert(parent_ptr_type->id == ZigTypeIdPointer); | 17396 | assert(parent_ptr_type->id == ZigTypeIdPointer); |
| 17397 | if ((err = type_resolve(ira->codegen, parent_ptr_type->data.pointer.child_type, | 17397 | ZigType *child_type = parent_ptr_type->data.pointer.child_type; |
| 17398 | ResolveStatusAlignmentKnown))) | 17398 | |
| 17399 | { | 17399 | bool has_bits; |
| | 17400 | if ((err = type_has_bits2(ira->codegen, child_type, &has_bits))) { |
| | 17401 | return ira->codegen->invalid_instruction; |
| | 17402 | } |
| | 17403 | |
| | 17404 | // This happens when the bitCast result is assigned to _ |
| | 17405 | if (!has_bits) { |
| | 17406 | assert(allow_discard); |
| | 17407 | return parent_result_loc; |
| | 17408 | } |
| | 17409 | |
| | 17410 | if ((err = type_resolve(ira->codegen, child_type, ResolveStatusAlignmentKnown))) { |
| 17400 | return ira->codegen->invalid_instruction; | 17411 | return ira->codegen->invalid_instruction; |
| 17401 | } | 17412 | } |
| | 17413 | |
| 17402 | uint64_t parent_ptr_align = get_ptr_align(ira->codegen, parent_ptr_type); | 17414 | uint64_t parent_ptr_align = get_ptr_align(ira->codegen, parent_ptr_type); |
| 17403 | if ((err = type_resolve(ira->codegen, value_type, ResolveStatusAlignmentKnown))) { | 17415 | if ((err = type_resolve(ira->codegen, value_type, ResolveStatusAlignmentKnown))) { |
| 17404 | return ira->codegen->invalid_instruction; | 17416 | return ira->codegen->invalid_instruction; |