authorgravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-06-11 18:40:55-05:00
committergravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-06-11 19:19:44-05:00
log3ed6acd2d20de0a2a08ddf6549fb06a66687d96a
tree5687e7007a08ffd023183016a7234d82e8bf6512
parente12c7d88b28200bc64a538cd4812bfe58a6b6b78

fixed infinite loop when caching packages


1 files changed, 2 insertions(+), 0 deletions(-)

src/codegen.cpp+2
...@@ -9373,6 +9373,8 @@ static void add_cache_pkg(CodeGen *g, CacheHash *ch, ZigPackage *pkg) {...@@ -9373,6 +9373,8 @@ static void add_cache_pkg(CodeGen *g, CacheHash *ch, ZigPackage *pkg) {
9373 // TODO: I think we need a more sophisticated detection of9373 // TODO: I think we need a more sophisticated detection of
9374 // packages we have already seen9374 // packages we have already seen
9375 if (entry->value != pkg) {9375 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;
9376 cache_buf(ch, entry->key);9378 cache_buf(ch, entry->key);
9377 add_cache_pkg(g, ch, entry->value);9379 add_cache_pkg(g, ch, entry->value);
9378 }9380 }