diff options
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r-- | include/llvm/Type.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h index 52229ac..617ef69 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -504,19 +504,19 @@ inline void PATypeHandle::removeUser() { /// reference to the type. /// inline Type* PATypeHolder::get() const { + if (Ty == 0) return 0; const Type *NewTy = Ty->getForwardedType(); if (!NewTy) return const_cast<Type*>(Ty); return *const_cast<PATypeHolder*>(this) = NewTy; } inline void PATypeHolder::addRef() { - assert(Ty && "Type Holder has a null type!"); - if (Ty->isAbstract()) + if (Ty && Ty->isAbstract()) Ty->addRef(); } inline void PATypeHolder::dropRef() { - if (Ty->isAbstract()) + if (Ty && Ty->isAbstract()) Ty->dropRef(); } |