Skip to content

Commit 3ed6acd

Browse files
committed
fixed infinite loop when caching packages
1 parent e12c7d8 commit 3ed6acd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/codegen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9373,6 +9373,8 @@ static void add_cache_pkg(CodeGen *g, CacheHash *ch, ZigPackage *pkg) {
93739373
// TODO: I think we need a more sophisticated detection of
93749374
// packages we have already seen
93759375
if (entry->value != pkg) {
9376+
auto root = pkg->package_table.maybe_get(buf_create_from_str("@root"));
9377+
if (root != nullptr && entry->value == root->value) continue;
93769378
cache_buf(ch, entry->key);
93779379
add_cache_pkg(g, ch, entry->value);
93789380
}

0 commit comments

Comments
 (0)