motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 03e2c53747a7eeb0d162f7b7fa7763fffdeba2d8 (tree)
parent 31ba9d569b14a3e147d9bdfe88d63a1ed134bc5f
Author: daurnimator <quae@daurnimator.com>
Date:   Sat,  2 Jan 2021 01:10:47 +1100

Add workaround in PackedIntArray .initAllTo for #7635

Diffstat:
Mlib/std/packed_int_array.zig | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/std/packed_int_array.zig b/lib/std/packed_int_array.zig @@ -205,7 +205,8 @@ pub fn PackedIntArrayEndian(comptime Int: type, comptime endian: builtin.Endian, ///Initialize all entries of a packed array to the same value pub fn initAllTo(int: Int) Self { - var self = @as(Self, undefined); + // TODO: use `var self = @as(Self, undefined);` https://github.com/ziglang/zig/issues/7635 + var self = Self{ .bytes = [_]u8{0} ** total_bytes }; self.setAll(int); return self; }