From b6133931d04afc6980dfff2e87dadc85922d5335 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 31 Mar 2022 12:25:48 -0700 Subject: [PATCH] Sema: fix segfault during resolveInferredErrorSet There was a simple missing check of adding an inferred error set to itself, in which case we should not try to mutate the hash map while iterating over it. --- src/Sema.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Sema.zig b/src/Sema.zig index 9f5d6d5f9e..6ab89af3f9 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -21549,6 +21549,7 @@ fn resolveInferredErrorSet( var it = ies.inferred_error_sets.keyIterator(); while (it.next()) |other_error_set_ptr| { const other_ies: *Module.Fn.InferredErrorSet = other_error_set_ptr.*; + if (ies == other_ies) continue; try sema.resolveInferredErrorSet(block, src, other_ies); for (other_ies.errors.keys()) |key| {