add an assertion to catch a null PATypeHolder, patch by Erick Tryzelaar
authorChris Lattner <sabre@nondot.org>
Mon, 25 Feb 2008 21:28:46 +0000 (21:28 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 25 Feb 2008 21:28:46 +0000 (21:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47563 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Type.h

index db177994aeef28415c84d464e21d82e6c964b569..1ee84e2cabe256edfd5993c772297b604fea3b9c 100644 (file)
@@ -357,9 +357,10 @@ inline void PATypeHandle::removeUser() {
     Ty->removeAbstractTypeUser(User);
 }
 
-// Define inline methods for PATypeHolder...
+// Define inline methods for PATypeHolder.
 
 inline void PATypeHolder::addRef() {
+  assert(Ty && "Type Holder has a null type!");
   if (Ty->isAbstract())
     Ty->addRef();
 }