| ... | @@ -4580,7 +4580,18 @@ fn airUnwrapErrUnionPay(f: *Function, inst: Air.Inst.Index, is_ptr: bool) !CValu | ... | @@ -4580,7 +4580,18 @@ fn airUnwrapErrUnionPay(f: *Function, inst: Air.Inst.Index, is_ptr: bool) !CValu |
| 4580 | const operand_is_ptr = operand_ty.zigTypeTag() == .Pointer; | 4580 | const operand_is_ptr = operand_ty.zigTypeTag() == .Pointer; |
| 4581 | const error_union_ty = if (operand_is_ptr) operand_ty.childType() else operand_ty; | 4581 | const error_union_ty = if (operand_is_ptr) operand_ty.childType() else operand_ty; |
| 4582 | | 4582 | |
| 4583 | if (!error_union_ty.errorUnionPayload().hasRuntimeBits()) return CValue.none; | 4583 | if (!error_union_ty.errorUnionPayload().hasRuntimeBits()) { |
| | 4584 | if (!is_ptr) return CValue.none; |
| | 4585 | |
| | 4586 | const local = try f.allocLocal(inst_ty, .Const); |
| | 4587 | const w = f.object.writer(); |
| | 4588 | try w.writeAll(" = ("); |
| | 4589 | try f.renderTypecast(w, inst_ty); |
| | 4590 | try w.writeByte(')'); |
| | 4591 | try f.writeCValue(w, operand, .Initializer); |
| | 4592 | try w.writeAll(";\n"); |
| | 4593 | return local; |
| | 4594 | } |
| 4584 | | 4595 | |
| 4585 | const writer = f.object.writer(); | 4596 | const writer = f.object.writer(); |
| 4586 | const local = try f.allocLocal(inst_ty, .Const); | 4597 | const local = try f.allocLocal(inst_ty, .Const); |