summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2019-07-11 10:53:40 +0000
committerFlorian Hahn <flo@fhahn.com>2019-07-11 10:53:40 +0000
commit3b9994615f484d028ab476cf31bf6e62558364e8 (patch)
tree63e6d7abf1a3bce2700948ad3af98c812a6fe5a9 /llvm
parentc05f67712db20abb5e236f9961aeb0710ccaa436 (diff)
downloadbcm5719-llvm-3b9994615f484d028ab476cf31bf6e62558364e8.tar.gz
bcm5719-llvm-3b9994615f484d028ab476cf31bf6e62558364e8.zip
Revert [BitcodeReader] Validate OpNum, before accessing Record array.
This reverts r365750 (git commit 8b222ecf2769ee133691f208f6166ce118c4a164) 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
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp4
-rw-r--r--llvm/test/Bitcode/Inputs/invalid-fcmp-opnum.bcbin908 -> 0 bytes
-rw-r--r--llvm/test/Bitcode/invalid.test5
3 files changed, 0 insertions, 9 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 0d302b7dfaa..0ba76f0f371 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -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;
diff --git a/llvm/test/Bitcode/Inputs/invalid-fcmp-opnum.bc b/llvm/test/Bitcode/Inputs/invalid-fcmp-opnum.bc
deleted file mode 100644
index 454a14b8611..00000000000
--- a/llvm/test/Bitcode/Inputs/invalid-fcmp-opnum.bc
+++ /dev/null
Binary files differ
diff --git a/llvm/test/Bitcode/invalid.test b/llvm/test/Bitcode/invalid.test
index d1f9d7c0874..2a9af0626c6 100644
--- a/llvm/test/Bitcode/invalid.test
+++ b/llvm/test/Bitcode/invalid.test
@@ -235,8 +235,3 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-nonpointer-atomicrmw.bc 2>&1
RUN: FileCheck --check-prefix=NONPOINTER-ATOMICRMW %s
NONPOINTER-ATOMICRMW: Invalid record
-
-RUN: not llvm-dis -disable-output %p/Inputs/invalid-fcmp-opnum.bc 2>&1 | \
-RUN: FileCheck --check-prefix=INVALID-FCMP-OPNUM %s
-
-INVALID-FCMP-OPNUM: Invalid record: operand number exceeded available operands
OpenPOWER on IntegriCloud