summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-09-08 18:43:33 +0000
committeremaste <emaste@FreeBSD.org>2014-09-08 18:43:33 +0000
commitd7464b842403dbf1327e33bc20efe0c19c0c3740 (patch)
tree3a0b00639ef132281224c539c823451d359db91b
parent6700790119646c1106547f9914c629c8b92b3590 (diff)
downloadFreeBSD-src-d7464b842403dbf1327e33bc20efe0c19c0c3740.zip
FreeBSD-src-d7464b842403dbf1327e33bc20efe0c19c0c3740.tar.gz
Merge Clang debug info crash fix rev 200797:
Debug info: fix a crasher when when emitting debug info for not-yet-completed templated types. getTypeSize() needs a complete type. rdar://problem/15931354 PR: 193347 MFC after: 3 days Sponsored by: DARPA, AFRL
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
index 8be351e..b4109c7 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2235,9 +2235,10 @@ llvm::DICompositeType CGDebugInfo::CreateLimitedType(const RecordType *Ty) {
if (T && (!T.isForwardDecl() || !RD->getDefinition()))
return T;
- // If this is just a forward declaration, construct an appropriately
- // marked node and just return it.
- if (!RD->getDefinition())
+ // If this is just a forward or incomplete declaration, construct an
+ // appropriately marked node and just return it.
+ const RecordDecl *D = RD->getDefinition();
+ if (!D || !D->isCompleteDefinition())
return getOrCreateRecordFwdDecl(Ty, RDContext);
uint64_t Size = CGM.getContext().getTypeSize(Ty);
OpenPOWER on IntegriCloud