| ... | @@ -17606,12 +17606,15 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, IrInstruction *suspend_s | ... | @@ -17606,12 +17606,15 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, IrInstruction *suspend_s |
| 17606 | if (actual_elem_type->id == ZigTypeIdOptional && value_type->id != ZigTypeIdOptional && | 17606 | if (actual_elem_type->id == ZigTypeIdOptional && value_type->id != ZigTypeIdOptional && |
| 17607 | value_type->id != ZigTypeIdNull) | 17607 | value_type->id != ZigTypeIdNull) |
| 17608 | { | 17608 | { |
| 17609 | bool has_bits; | 17609 | bool same_comptime_repr = types_have_same_zig_comptime_repr(ira->codegen, actual_elem_type, value_type); |
| 17610 | if ((err = type_has_bits2(ira->codegen, value_type, &has_bits))) | 17610 | if (!same_comptime_repr) { |
| 17611 | return ira->codegen->invalid_instruction; | 17611 | bool has_bits; |
| 17612 | if (has_bits) { | 17612 | if ((err = type_has_bits2(ira->codegen, value_type, &has_bits))) |
| 17613 | result_loc_pass1->written = false; | 17613 | return ira->codegen->invalid_instruction; |
| 17614 | return ir_analyze_unwrap_optional_payload(ira, suspend_source_instr, result_loc, false, true); | 17614 | if (has_bits) { |
| | 17615 | result_loc_pass1->written = false; |
| | 17616 | return ir_analyze_unwrap_optional_payload(ira, suspend_source_instr, result_loc, false, true); |
| | 17617 | } |
| 17615 | } | 17618 | } |
| 17616 | } else if (actual_elem_type->id == ZigTypeIdErrorUnion && value_type->id != ZigTypeIdErrorUnion) { | 17619 | } else if (actual_elem_type->id == ZigTypeIdErrorUnion && value_type->id != ZigTypeIdErrorUnion) { |
| 17617 | bool has_bits; | 17620 | bool has_bits; |