summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
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
commita77bb942a2c7d77e567350874c2dda5109653b81 (patch)
tree12f664b7e0ec4a005c623cc08199ec5cd2b2c31e /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent5db36d3d82769e982ba502d8f768bd40449f97ed (diff)
downloadbcm5719-llvm-a77bb942a2c7d77e567350874c2dda5109653b81.tar.gz
bcm5719-llvm-a77bb942a2c7d77e567350874c2dda5109653b81.zip
add a missing check
llvm-svn: 36859
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 283cd1df775..2e9de1c1f13 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud