From: Sean Callanan Date: Thu, 15 Mar 2012 16:33:08 +0000 (+0000) Subject: When laying out an Objective-C object, consult X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cad313bd7b28674e0e409e610c450a2411107443;p=clang When laying out an Objective-C object, consult the external source to complete the Decl if it hasn't been completed already. This fixes a crash in LLDB. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152807 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp index f73287503e..c2d9294a00 100644 --- a/lib/AST/RecordLayoutBuilder.cpp +++ b/lib/AST/RecordLayoutBuilder.cpp @@ -2313,6 +2313,8 @@ const ASTRecordLayout & ASTContext::getObjCLayout(const ObjCInterfaceDecl *D, const ObjCImplementationDecl *Impl) const { // Retrieve the definition + if (D->hasExternalLexicalStorage() && !D->getDefinition()) + getExternalSource()->CompleteType(const_cast(D)); D = D->getDefinition(); assert(D && D->isThisDeclarationADefinition() && "Invalid interface decl!");