| ... | ... | @@ -19278,7 +19278,7 @@ static IrInstruction *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionPh |
| 19278 | 19278 | return new_incoming_values.at(0); |
| 19279 | 19279 | } |
| 19280 | 19280 | |
| 19281 | | ZigType *resolved_type; |
| 19281 | ZigType *resolved_type = nullptr; |
| 19282 | 19282 | if (peer_parent != nullptr) { |
| 19283 | 19283 | bool peer_parent_has_type; |
| 19284 | 19284 | if ((err = ir_result_has_type(ira, peer_parent->parent, &peer_parent_has_type))) |
| ... | ... | @@ -19288,23 +19288,23 @@ static IrInstruction *ir_analyze_instruction_phi(IrAnalyze *ira, IrInstructionPh |
| 19288 | 19288 | resolved_type = ira->explicit_return_type; |
| 19289 | 19289 | } else if (peer_parent->parent->id == ResultLocIdCast) { |
| 19290 | 19290 | resolved_type = ir_resolve_type(ira, peer_parent->parent->source_instruction->child); |
| 19291 | | if (type_is_invalid(resolved_type)) |
| 19292 | | return ira->codegen->invalid_instruction; |
| 19293 | | } else { |
| 19291 | } else if (peer_parent->parent->resolved_loc) { |
| 19294 | 19292 | ZigType *resolved_loc_ptr_type = peer_parent->parent->resolved_loc->value->type; |
| 19295 | 19293 | ir_assert(resolved_loc_ptr_type->id == ZigTypeIdPointer, &phi_instruction->base); |
| 19296 | 19294 | resolved_type = resolved_loc_ptr_type->data.pointer.child_type; |
| 19297 | 19295 | } |
| 19298 | | goto skip_resolve_peer_types; |
| 19296 | |
| 19297 | if (resolved_type != nullptr && type_is_invalid(resolved_type)) |
| 19298 | return ira->codegen->invalid_instruction; |
| 19299 | 19299 | } |
| 19300 | 19300 | } |
| 19301 | | { |
| 19301 | |
| 19302 | if (resolved_type == nullptr) { |
| 19302 | 19303 | resolved_type = ir_resolve_peer_types(ira, phi_instruction->base.source_node, nullptr, |
| 19303 | 19304 | new_incoming_values.items, new_incoming_values.length); |
| 19304 | 19305 | if (type_is_invalid(resolved_type)) |
| 19305 | 19306 | return ira->codegen->invalid_instruction; |
| 19306 | 19307 | } |
| 19307 | | skip_resolve_peer_types: |
| 19308 | 19308 | |
| 19309 | 19309 | switch (type_has_one_possible_value(ira->codegen, resolved_type)) { |
| 19310 | 19310 | case OnePossibleValueInvalid: |