diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-03-31 12:25:48 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-03-31 12:25:48 -0700 |
| commit | b6133931d04afc6980dfff2e87dadc85922d5335 (patch) | |
| tree | 139869f6dee5fc8c4725c78ddc4780e56c46f059 /src | |
| parent | cf4aad4858ac61b4814d8f021c8eae22ee7f63e6 (diff) | |
| download | zig-b6133931d04afc6980dfff2e87dadc85922d5335.tar.gz zig-b6133931d04afc6980dfff2e87dadc85922d5335.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Sema.zig | 1 |
1 files changed, 1 insertions, 0 deletions
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| { |
