aboutsummaryrefslogtreecommitdiff
path: root/src/InternPool.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-07-16 10:47:42 -0700
committerGitHub <noreply@github.com>2024-07-16 10:47:42 -0700
commita58ceb3d554a9565a6cc0443f6384149ae2b3145 (patch)
treeaf66e289a0ae028be92389722979ed270b42ee42 /src/InternPool.zig
parenta9d544575d5bd2a939b09b8f088bee5d8ff7b0d9 (diff)
parent7dbd2a6bb549afa6dc3c95df46f40bf144db23a6 (diff)
downloadzig-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.zig10
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;
+ }
}
};