mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Revert "Verify sizes when trying to read a VBR"
This reverts r234984 since it seems to break some bots (most of them seemed arm*-selfhost). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234998 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -395,7 +395,6 @@ public:
|
|||||||
// Read a VBR that may have a value up to 64-bits in size. The chunk size of
|
// Read a VBR that may have a value up to 64-bits in size. The chunk size of
|
||||||
// the VBR must still be <= 32 bits though.
|
// the VBR must still be <= 32 bits though.
|
||||||
uint64_t ReadVBR64(unsigned NumBits) {
|
uint64_t ReadVBR64(unsigned NumBits) {
|
||||||
assert(NumBits <= 64 && "VBR can only be up to 64 bits in size.");
|
|
||||||
uint32_t Piece = Read(NumBits);
|
uint32_t Piece = Read(NumBits);
|
||||||
if ((Piece & (1U << (NumBits-1))) == 0)
|
if ((Piece & (1U << (NumBits-1))) == 0)
|
||||||
return uint64_t(Piece);
|
return uint64_t(Piece);
|
||||||
|
@@ -62,8 +62,6 @@ static uint64_t readAbbreviatedField(BitstreamCursor &Cursor,
|
|||||||
case BitCodeAbbrevOp::Fixed:
|
case BitCodeAbbrevOp::Fixed:
|
||||||
return Cursor.Read((unsigned)Op.getEncodingData());
|
return Cursor.Read((unsigned)Op.getEncodingData());
|
||||||
case BitCodeAbbrevOp::VBR:
|
case BitCodeAbbrevOp::VBR:
|
||||||
if ((unsigned)Op.getEncodingData() > 64)
|
|
||||||
report_fatal_error("Invalid record");
|
|
||||||
return Cursor.ReadVBR64((unsigned)Op.getEncodingData());
|
return Cursor.ReadVBR64((unsigned)Op.getEncodingData());
|
||||||
case BitCodeAbbrevOp::Char6:
|
case BitCodeAbbrevOp::Char6:
|
||||||
return BitCodeAbbrevOp::DecodeChar6(Cursor.Read(6));
|
return BitCodeAbbrevOp::DecodeChar6(Cursor.Read(6));
|
||||||
|
Binary file not shown.
@@ -55,8 +55,3 @@ RUN: not llvm-dis -disable-output %p/Inputs/invalid-no-proper-module.bc 2>&1 | \
|
|||||||
RUN: FileCheck --check-prefix=NO-MODULE %s
|
RUN: FileCheck --check-prefix=NO-MODULE %s
|
||||||
|
|
||||||
NO-MODULE: Malformed IR file
|
NO-MODULE: Malformed IR file
|
||||||
|
|
||||||
RUN: not llvm-dis -disable-output %p/Inputs/invalid-VBR-too-big.bc 2>&1 | \
|
|
||||||
RUN: FileCheck --check-prefix=HUGE-VBR %s
|
|
||||||
|
|
||||||
HUGE-VBR: Invalid record
|
|
||||||
|
Reference in New Issue
Block a user