add a missing check

llvm-svn: 36859
This commit is contained in:
Chris Lattner
2007-05-06 07:33:01 +00:00
parent 5db36d3d82
commit a77bb942a2

View File

@@ -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);
}