motiejus/zig

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

commit 7d9cf156c381743ef7ede8a35c4a9c46e6033dd7 (tree)
parent dca17d3603e5b68a8f683bfc1bdabc9959654d26
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Wed, 20 Sep 2023 20:04:55 -0700

TypedValue: fix crash for tuples when printing

Diffstat:
Msrc/TypedValue.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/TypedValue.zig b/src/TypedValue.zig @@ -437,7 +437,7 @@ fn printAggregate( if (i != 0) try writer.writeAll(", "); const field_name = switch (ip.indexToKey(ty.toIntern())) { - .struct_type => |x| x.field_names.get(ip)[i].toOptional(), + .struct_type => |x| x.fieldName(ip, i), .anon_struct_type => |x| if (x.isTuple()) .none else x.names.get(ip)[i].toOptional(), else => unreachable, };