From 77810f288216ef3e35f3d0df4a04351297560a5e Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Wed, 10 Jul 2024 22:55:54 -0400 Subject: InternPool: fix optimization assertion failure --- src/InternPool.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/InternPool.zig') diff --git a/src/InternPool.zig b/src/InternPool.zig index 258bc72a6d..2b21b25a1d 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -10969,7 +10969,8 @@ const GlobalErrorSet = struct { /// Not thread-safe, may only be called from the main thread. pub fn getNamesFromMainThread(ges: *const GlobalErrorSet) []const NullTerminatedString { - return ges.shared.names.view().items(.@"0")[0..ges.mutate.list.len]; + const len = ges.mutate.list.len; + return if (len > 0) ges.shared.names.view().items(.@"0")[0..len] else &.{}; } fn getErrorValue( -- cgit v1.2.3