summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-06 07:33:01 +0000
committerChris Lattner <sabre@nondot.org>2007-05-06 07:33:01 +0000
commitbfcc38040b6a0667b7b7df9674d8a0ed1d104814 (patch)
tree248b0410927060f51701dedeadb624158e0522ea /lib
parent82e791dc420c399b7382a4754019b80466c898b0 (diff)
downloadllvm-bfcc38040b6a0667b7b7df9674d8a0ed1d104814.tar.gz
llvm-bfcc38040b6a0667b7b7df9674d8a0ed1d104814.tar.bz2
llvm-bfcc38040b6a0667b7b7df9674d8a0ed1d104814.tar.xz
add a missing check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 283cd1df77..2e9de1c1f1 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);
}