authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-05 15:21:43-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-05 15:22:19-07:00
log388520a40b866dc43cd130fcbaeda866ccd4217e
treeb779ee306b210986d6748782f347922a591819c1
parent2ee864ca5eb46468e8e0f4237a5532b76b60d715

fix behavior test which was relying on UB


1 files changed, 2 insertions(+), 1 deletions(-)

test/behavior/bugs/9584.zig+2-1
...@@ -35,7 +35,8 @@ pub fn a(...@@ -35,7 +35,8 @@ pub fn a(
35 _ = flag_a;35 _ = flag_a;
36 // With this bug present, `flag_b` would actually contain the value 17.36 // With this bug present, `flag_b` would actually contain the value 17.
37 // Note: this bug only presents itself on debug mode.37 // Note: this bug only presents itself on debug mode.
38 try std.testing.expect(@ptrCast(*const u8, &flag_b).* == 1);38 const flag_b_byte: u8 = @boolToInt(flag_b);
39 try std.testing.expect(flag_b_byte == 1);
39}40}
4041
41pub fn b(x: *X) !void {42pub fn b(x: *X) !void {