aboutsummaryrefslogtreecommitdiff
path: root/lib/std/packed_int_array.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/packed_int_array.zig')
-rw-r--r--lib/std/packed_int_array.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/packed_int_array.zig b/lib/std/packed_int_array.zig
index c726f17672..c53d6f0505 100644
--- 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;
}