[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

@@ -247,7 +247,8 @@ static bool printModuleInterfaceDecl(Decl *D,
// a cross-module extension.
if (!extensionHasClangNode(Ext)) {
auto ExtendedNominal = Ext->getExtendedNominal();
if (Ext->getModuleContext() == ExtendedNominal->getModuleContext())
if (!ExtendedNominal ||
Ext->getModuleContext() == ExtendedNominal->getModuleContext())
return false;
}
}