| ... | ... | @@ -1063,13 +1063,12 @@ pub fn genTypedValue( |
| 1063 | 1063 | }, |
| 1064 | 1064 | .Optional => { |
| 1065 | 1065 | if (typed_value.ty.isPtrLikeOptional()) { |
| 1066 | | if (typed_value.val.isNull()) |
| 1067 | | return GenResult.mcv(.{ .immediate = 0 }); |
| 1066 | if (typed_value.val.tag() == .null_value) return GenResult.mcv(.{ .immediate = 0 }); |
| 1068 | 1067 | |
| 1069 | 1068 | var buf: Type.Payload.ElemType = undefined; |
| 1070 | 1069 | return genTypedValue(bin_file, src_loc, .{ |
| 1071 | 1070 | .ty = typed_value.ty.optionalChild(&buf), |
| 1072 | | .val = typed_value.val, |
| 1071 | .val = if (typed_value.val.castTag(.opt_payload)) |pl| pl.data else typed_value.val, |
| 1073 | 1072 | }, owner_decl_index); |
| 1074 | 1073 | } else if (typed_value.ty.abiSize(target) == 1) { |
| 1075 | 1074 | return GenResult.mcv(.{ .immediate = @boolToInt(!typed_value.val.isNull()) }); |