type can be null
authorChris Lattner <sabre@nondot.org>
Thu, 7 Jul 2011 05:29:18 +0000 (05:29 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 7 Jul 2011 05:29:18 +0000 (05:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134601 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Reader/BitcodeReader.h

index 1fa6f827b9cfcaef91b0e09b56d6bdd896a8c488..14033b095c65bc70b13ca18619e33829ff23d213 100644 (file)
@@ -212,7 +212,7 @@ public:
 private:
   const Type *getTypeByID(unsigned ID, bool isTypeTable = false);
   Value *getFnValueByID(unsigned ID, const Type *Ty) {
-    if (Ty->isMetadataTy())
+    if (Ty && Ty->isMetadataTy())
       return MDValueList.getValueFwdRef(ID);
     return ValueList.getValueFwdRef(ID, Ty);
   }