zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit b28b3f6f7b1dd4c3c8a0f3d3a6305a84daed8ead (tree)
parent 273da9efd9238e20da1299789537b00de2f0ebd8
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu, 10 Mar 2022 22:57:13 -0700

stage2: fix comptime element load of undef array

Diffstat:
Msrc/value.zig | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/value.zig b/src/value.zig @@ -2336,6 +2336,8 @@ pub const Value = extern union { buffer: *ElemValueBuffer, ) error{OutOfMemory}!Value { switch (val.tag()) { + // This is the case of accessing an element of an undef array. + .undef => return Value.undef, .empty_array => unreachable, // out of bounds array index .empty_struct_value => unreachable, // out of bounds array index