diff options
author | emaste <emaste@FreeBSD.org> | 2014-09-08 18:43:33 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2014-09-08 18:43:33 +0000 |
commit | d7464b842403dbf1327e33bc20efe0c19c0c3740 (patch) | |
tree | 3a0b00639ef132281224c539c823451d359db91b /contrib/llvm/tools | |
parent | 6700790119646c1106547f9914c629c8b92b3590 (diff) | |
download | FreeBSD-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
Diffstat (limited to 'contrib/llvm/tools')
-rw-r--r-- | contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp | 7 |
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); |