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.
This commit is contained in:
Andrew Kelley 2022-03-31 12:25:48 -07:00
parent cf4aad4858
commit b6133931d0

View File

@ -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| {