[Serialization] Fix crashes when allowing compiler errors in modules

This commit is contained in:
Ben Barham
2020-11-06 13:29:44 +10:00
parent a9f5107b44
commit b07c06e839
11 changed files with 135 additions and 78 deletions

View File

@@ -92,8 +92,11 @@ public:
if (auto module = dyn_cast<ModuleDecl>(dc)) {
out << module->getName() << ".";
} else if (auto extension = dyn_cast<ExtensionDecl>(dc)) {
printDecl(out, extension->getExtendedNominal());
out << ".";
auto *extended = extension->getExtendedNominal();
if (extended) {
printDecl(out, extended);
out << ".";
}
} else if (auto decl = dyn_cast_or_null<ValueDecl>(dc->getAsDecl())) {
printDecl(out, decl);
out << ".";