AST: Fix crash when doing name lookup into class with circular inheritance

This commit is contained in:
Slava Pestov
2018-07-10 13:49:00 -07:00
parent 559c0fd33d
commit 00b3ce18ca
3 changed files with 23 additions and 3 deletions

View File

@@ -319,6 +319,10 @@ void ConformanceLookupTable::updateLookupTable(NominalTypeDecl *nominal,
return;
llvm::SaveAndRestore<bool> visiting(VisitingSuperclass, true);
// Don't update our own lookup table if we inherit from ourselves.
if (classDecl == superclassDecl)
break;
// Resolve the conformances of the superclass.
superclassDecl->prepareConformanceTable();
superclassDecl->ConformanceTable->updateLookupTable(