From 03ad862197d27fb079d16cabdf2026da23aa2653 Mon Sep 17 00:00:00 2001 From: mlugg Date: Tue, 16 Apr 2024 21:49:08 +0100 Subject: compiler: un-implement #19634 This commit reverts the handling of partially-undefined values in bitcasting to transform these bits into an arbitrary numeric value, like happens on `master` today. As @andrewrk rightly points out, #19634 has unfortunate consequences for the standard library, and likely requires more thought. To avoid a major breaking change, it has been decided to revert this design decision for now, and make a more informed decision further down the line. --- lib/std/packed_int_array.zig | 8 -------- 1 file changed, 8 deletions(-) (limited to 'lib/std/packed_int_array.zig') diff --git a/lib/std/packed_int_array.zig b/lib/std/packed_int_array.zig index d76df4d04e..02c721e7cf 100644 --- a/lib/std/packed_int_array.zig +++ b/lib/std/packed_int_array.zig @@ -214,10 +214,6 @@ pub fn PackedIntArrayEndian(comptime Int: type, comptime endian: Endian, comptim /// or, more likely, an array literal. pub fn init(ints: [int_count]Int) Self { var self: Self = undefined; - if (@inComptime()) { - // TODO: #19634 - @memset(&self.bytes, 0xAA); - } for (ints, 0..) |int, i| self.set(i, int); return self; } @@ -225,10 +221,6 @@ pub fn PackedIntArrayEndian(comptime Int: type, comptime endian: Endian, comptim /// Initialize all entries of a packed array to the same value. pub fn initAllTo(int: Int) Self { var self: Self = undefined; - if (@inComptime()) { - // TODO: #19634 - @memset(&self.bytes, 0xAA); - } self.setAll(int); return self; } -- cgit v1.2.3