Revert [BitcodeReader] Validate OpNum, before accessing Record array.

This reverts r365750 (git commit 8b222ecf27)

llvm-dis runs out of memory while opening invalid-fcmp-opnum.bc on
llvm-hexagon-elf, probably because the bitcode file contains other
suspicious values.

http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/21949

llvm-svn: 365757
This commit is contained in:
Florian Hahn
2019-07-11 10:53:40 +00:00
parent c05f67712d
commit 3b9994615f
3 changed files with 0 additions and 9 deletions

View File

@@ -4165,10 +4165,6 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
popValue(Record, OpNum, NextValueNo, LHS->getType(), RHS))
return error("Invalid record");
if (OpNum >= Record.size())
return error(
"Invalid record: operand number exceeded available operands");
unsigned PredVal = Record[OpNum];
bool IsFP = LHS->getType()->isFPOrFPVectorTy();
FastMathFlags FMF;