[BitcodeReader] Change assert to report_fatal_error

It can be triggered by user input.

Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238272 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Filipe Cabecinhas
2015-05-27 01:05:40 +00:00
parent 316f9e05ce
commit 1c0b496636
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);
}