diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-07-16 10:47:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-16 10:47:42 -0700 |
| commit | a58ceb3d554a9565a6cc0443f6384149ae2b3145 (patch) | |
| tree | af66e289a0ae028be92389722979ed270b42ee42 /src/InternPool.zig | |
| parent | a9d544575d5bd2a939b09b8f088bee5d8ff7b0d9 (diff) | |
| parent | 7dbd2a6bb549afa6dc3c95df46f40bf144db23a6 (diff) | |
| download | zig-a58ceb3d554a9565a6cc0443f6384149ae2b3145.tar.gz zig-a58ceb3d554a9565a6cc0443f6384149ae2b3145.zip | |
Merge pull request #20646 from ziglang/fix-updateZirRefs
frontend: fix updateZirRefs
Diffstat (limited to 'src/InternPool.zig')
| -rw-r--r-- | src/InternPool.zig | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index ff748ebc62..2440ccff3b 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -283,10 +283,12 @@ pub const DependencyIterator = struct { ip: *const InternPool, next_entry: DepEntry.Index.Optional, pub fn next(it: *DependencyIterator) ?AnalUnit { - const idx = it.next_entry.unwrap() orelse return null; - const entry = it.ip.dep_entries.items[@intFromEnum(idx)]; - it.next_entry = entry.next; - return entry.depender.unwrap().?; + while (true) { + const idx = it.next_entry.unwrap() orelse return null; + const entry = it.ip.dep_entries.items[@intFromEnum(idx)]; + it.next_entry = entry.next; + if (entry.depender.unwrap()) |depender| return depender; + } } }; |
