Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Sep 2014 18:43:33 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271282 - head/contrib/llvm/tools/clang/lib/CodeGen
Message-ID:  <201409081843.s88IhXTn024884@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Mon Sep  8 18:43:33 2014
New Revision: 271282
URL: http://svnweb.freebsd.org/changeset/base/271282

Log:
  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

Modified:
  head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp

Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp	Mon Sep  8 18:11:20 2014	(r271281)
+++ head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp	Mon Sep  8 18:43:33 2014	(r271282)
@@ -2235,9 +2235,10 @@ llvm::DICompositeType CGDebugInfo::Creat
   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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409081843.s88IhXTn024884>