diff options
author | emaste <emaste@FreeBSD.org> | 2014-09-11 01:53:55 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2014-09-11 01:53:55 +0000 |
commit | 8081f48b5d0c01d86d5b3d32021fa12d8138cba1 (patch) | |
tree | b7a07adca4d96eb4216bb92429c8629342625eb3 /contrib/llvm/tools/clang | |
parent | b2f9aa76a4bbf30efec9702139f27c272bbdfa80 (diff) | |
download | FreeBSD-src-8081f48b5d0c01d86d5b3d32021fa12d8138cba1.zip FreeBSD-src-8081f48b5d0c01d86d5b3d32021fa12d8138cba1.tar.gz |
MFC Clang debug info crash fix
r271282: 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
r271283: Add clang patch for r271282
Note that r271282 contains only the src change from Clang rev 200797.
This patch file includes two follow-on changes to the test case, which
do not apply to the copy in the FreeBSD tree.
Upstream Clang revisions:
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
200798:
Simplify testcase from r200797 some more.
200805:
Further simplify r200797 and add an explanatory comment.
PR: 193347
Approved by: re
Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools/clang')
-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); |