[BitcodeReader] Change assert to report_fatal_error

It can be triggered by user input.

Bug found with AFL fuzz.

llvm-svn: 238272
This commit is contained in:
Filipe Cabecinhas
2015-05-27 01:05:40 +00:00
parent ad60a9a516
commit 6a92a3fe34
3 changed files with 7 additions and 1 deletions

View File

@@ -785,7 +785,8 @@ Constant *BitcodeReaderValueList::getConstantFwdRef(unsigned Idx,
resize(Idx + 1);
if (Value *V = ValuePtrs[Idx]) {
assert(Ty == V->getType() && "Type mismatch in constant table!");
if (Ty != V->getType())
report_fatal_error("Type mismatch in constant table!");
return cast<Constant>(V);
}