unsigned BitsInCurWord = 0;
public:
- static const constexpr size_t MaxChunkSize = sizeof(word_t) * 8;
-
SimpleBitstreamCursor() = default;
explicit SimpleBitstreamCursor(ArrayRef<uint8_t> BitcodeBytes)
: BitcodeBytes(BitcodeBytes) {}
}
Expected<word_t> Read(unsigned NumBits) {
- static const unsigned BitsInWord = MaxChunkSize;
+ static const unsigned BitsInWord = sizeof(word_t) * 8;
assert(NumBits && NumBits <= BitsInWord &&
"Cannot return zero or more than BitsInWord bits!");
BitstreamBlockInfo *BlockInfo = nullptr;
public:
- static const size_t MaxChunkSize = sizeof(word_t) * 8;
+ static const size_t MaxChunkSize = 32;
BitstreamCursor() = default;
explicit BitstreamCursor(ArrayRef<uint8_t> BitcodeBytes)
RUN: FileCheck --check-prefix=COMDAT-NAME-TOO-LARGE %s
COMDAT-NAME-TOO-LARGE: Comdat name size too large
+
+RUN: not llvm-dis -disable-output %p/Inputs/invalid-chunk-size.bc 2>&1 | \
+RUN: FileCheck --check-prefix=INVALID-CHUNK-SIZE %s
+
+INVALID-CHUNK-SIZE: Fixed or VBR abbrev record with size > MaxChunkData