diff options
| author | emekoi <emekankurumeh@outlook.com> | 2019-06-11 18:40:55 -0500 |
|---|---|---|
| committer | emekoi <emekankurumeh@outlook.com> | 2019-06-11 19:19:44 -0500 |
| commit | 3ed6acd2d20de0a2a08ddf6549fb06a66687d96a (patch) | |
| tree | 5687e7007a08ffd023183016a7234d82e8bf6512 /src/codegen.cpp | |
| parent | e12c7d88b28200bc64a538cd4812bfe58a6b6b78 (diff) | |
| download | zig-3ed6acd2d20de0a2a08ddf6549fb06a66687d96a.tar.gz zig-3ed6acd2d20de0a2a08ddf6549fb06a66687d96a.zip | |
fixed infinite loop when caching packages
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index a50a416e40..56bc9827c5 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -9373,6 +9373,8 @@ static void add_cache_pkg(CodeGen *g, CacheHash *ch, ZigPackage *pkg) { // TODO: I think we need a more sophisticated detection of // packages we have already seen if (entry->value != pkg) { + auto root = pkg->package_table.maybe_get(buf_create_from_str("@root")); + if (root != nullptr && entry->value == root->value) continue; cache_buf(ch, entry->key); add_cache_pkg(g, ch, entry->value); } |
