mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 16:24:51 +00:00
x64: fix bug in lowering optionals directly to immediate
This commit is contained in:
parent
b0bb1583cb
commit
77072d1a17
@ -5688,7 +5688,7 @@ fn genTypedValue(self: *Self, typed_value: TypedValue) InnerError!MCValue {
|
||||
.val = typed_value.val,
|
||||
});
|
||||
} else if (typed_value.ty.abiSize(self.target.*) == 1) {
|
||||
return MCValue{ .immediate = @boolToInt(typed_value.val.isNull()) };
|
||||
return MCValue{ .immediate = @boolToInt(!typed_value.val.isNull()) };
|
||||
}
|
||||
},
|
||||
.Enum => {
|
||||
|
||||
@ -179,7 +179,7 @@ test "@floatCast comptime_int and comptime_float" {
|
||||
|
||||
test "coerce undefined to optional" {
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 or builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
|
||||
try expect(MakeType(void).getNull() == null);
|
||||
try expect(MakeType(void).getNonNull() != null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user