| ... | @@ -18668,14 +18668,16 @@ static IrInstGen *ir_resolve_result(IrAnalyze *ira, IrInst *suspend_source_instr | ... | @@ -18668,14 +18668,16 @@ static IrInstGen *ir_resolve_result(IrAnalyze *ira, IrInst *suspend_source_instr |
| 18668 | ir_assert(result_loc->value->type->id == ZigTypeIdPointer, suspend_source_instr); | 18668 | ir_assert(result_loc->value->type->id == ZigTypeIdPointer, suspend_source_instr); |
| 18669 | ZigType *actual_elem_type = result_loc->value->type->data.pointer.child_type; | 18669 | ZigType *actual_elem_type = result_loc->value->type->data.pointer.child_type; |
| 18670 | if (actual_elem_type->id == ZigTypeIdOptional && value_type->id != ZigTypeIdOptional && | 18670 | if (actual_elem_type->id == ZigTypeIdOptional && value_type->id != ZigTypeIdOptional && |
| 18671 | value_type->id != ZigTypeIdNull) | 18671 | value_type->id != ZigTypeIdNull && value_type->id != ZigTypeIdUndefined) |
| 18672 | { | 18672 | { |
| 18673 | bool same_comptime_repr = types_have_same_zig_comptime_repr(ira->codegen, actual_elem_type, value_type); | 18673 | bool same_comptime_repr = types_have_same_zig_comptime_repr(ira->codegen, actual_elem_type, value_type); |
| 18674 | if (!same_comptime_repr) { | 18674 | if (!same_comptime_repr) { |
| 18675 | result_loc_pass1->written = was_written; | 18675 | result_loc_pass1->written = was_written; |
| 18676 | return ir_analyze_unwrap_optional_payload(ira, suspend_source_instr, result_loc, false, true); | 18676 | return ir_analyze_unwrap_optional_payload(ira, suspend_source_instr, result_loc, false, true); |
| 18677 | } | 18677 | } |
| 18678 | } else if (actual_elem_type->id == ZigTypeIdErrorUnion && value_type->id != ZigTypeIdErrorUnion) { | 18678 | } else if (actual_elem_type->id == ZigTypeIdErrorUnion && value_type->id != ZigTypeIdErrorUnion && |
| | 18679 | value_type->id != ZigTypeIdUndefined) |
| | 18680 | { |
| 18679 | if (value_type->id == ZigTypeIdErrorSet) { | 18681 | if (value_type->id == ZigTypeIdErrorSet) { |
| 18680 | return ir_analyze_unwrap_err_code(ira, suspend_source_instr, result_loc, true); | 18682 | return ir_analyze_unwrap_err_code(ira, suspend_source_instr, result_loc, true); |
| 18681 | } else { | 18683 | } else { |
| ... | @@ -18683,7 +18685,7 @@ static IrInstGen *ir_resolve_result(IrAnalyze *ira, IrInst *suspend_source_instr | ... | @@ -18683,7 +18685,7 @@ static IrInstGen *ir_resolve_result(IrAnalyze *ira, IrInst *suspend_source_instr |
| 18683 | result_loc, false, true); | 18685 | result_loc, false, true); |
| 18684 | ZigType *actual_payload_type = actual_elem_type->data.error_union.payload_type; | 18686 | ZigType *actual_payload_type = actual_elem_type->data.error_union.payload_type; |
| 18685 | if (actual_payload_type->id == ZigTypeIdOptional && value_type->id != ZigTypeIdOptional && | 18687 | if (actual_payload_type->id == ZigTypeIdOptional && value_type->id != ZigTypeIdOptional && |
| 18686 | value_type->id != ZigTypeIdNull) | 18688 | value_type->id != ZigTypeIdNull && value_type->id != ZigTypeIdUndefined) |
| 18687 | { | 18689 | { |
| 18688 | return ir_analyze_unwrap_optional_payload(ira, suspend_source_instr, unwrapped_err_ptr, false, true); | 18690 | return ir_analyze_unwrap_optional_payload(ira, suspend_source_instr, unwrapped_err_ptr, false, true); |
| 18689 | } else { | 18691 | } else { |