From bfcc38040b6a0667b7b7df9674d8a0ed1d104814 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 May 2007 07:33:01 +0000 Subject: [PATCH] add a missing check git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36859 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/BitcodeReader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 283cd1df775..2e9de1c1f13 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -691,6 +691,7 @@ bool BitcodeReader::ParseConstants() { V = UndefValue::get(CurTy); // Unknown cast. } else { const Type *OpTy = getTypeByID(Record[1]); + if (!OpTy) return Error("Invalid CE_CAST record"); Constant *Op = ValueList.getConstantFwdRef(Record[2], OpTy); V = ConstantExpr::getCast(Opc, Op, CurTy); } -- 2.34.1