From f72ee4c2753650d4ea155c091bad725f236f7915 Mon Sep 17 00:00:00 2001 From: Filipe Cabecinhas Date: Wed, 15 Apr 2015 11:10:17 +0000 Subject: [PATCH] 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 --- include/llvm/Bitcode/BitstreamReader.h | 1 - lib/Bitcode/Reader/BitstreamReader.cpp | 2 -- test/Bitcode/Inputs/invalid-VBR-too-big.bc | Bin 612 -> 0 bytes test/Bitcode/invalid.test | 5 ----- 4 files changed, 8 deletions(-) delete mode 100644 test/Bitcode/Inputs/invalid-VBR-too-big.bc diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index bae816675c0..18f6b9e011e 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -395,7 +395,6 @@ public: // 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. uint64_t ReadVBR64(unsigned NumBits) { - assert(NumBits <= 64 && "VBR can only be up to 64 bits in size."); uint32_t Piece = Read(NumBits); if ((Piece & (1U << (NumBits-1))) == 0) return uint64_t(Piece); diff --git a/lib/Bitcode/Reader/BitstreamReader.cpp b/lib/Bitcode/Reader/BitstreamReader.cpp index 6e3bea1e87b..beaaf7a7d66 100644 --- a/lib/Bitcode/Reader/BitstreamReader.cpp +++ b/lib/Bitcode/Reader/BitstreamReader.cpp @@ -62,8 +62,6 @@ static uint64_t readAbbreviatedField(BitstreamCursor &Cursor, case BitCodeAbbrevOp::Fixed: return Cursor.Read((unsigned)Op.getEncodingData()); case BitCodeAbbrevOp::VBR: - if ((unsigned)Op.getEncodingData() > 64) - report_fatal_error("Invalid record"); return Cursor.ReadVBR64((unsigned)Op.getEncodingData()); case BitCodeAbbrevOp::Char6: return BitCodeAbbrevOp::DecodeChar6(Cursor.Read(6)); diff --git a/test/Bitcode/Inputs/invalid-VBR-too-big.bc b/test/Bitcode/Inputs/invalid-VBR-too-big.bc deleted file mode 100644 index 35d00ba154b5eb9dc4a6e06f94db7ea3c0202667..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 612 zcmZ>AK5$Qwhk;=l0|NthlL7-1kQM@B_D1E2jwe_=*#wL%Co#70sIqc!%CU4OHSoAH zIZfhrN)a#;vEY#K)3syKB`@je^r&ED}feT0* zDV^X@NNHu6thl5FNIY&?I6*|nr>%#(CB;WTK$)SK#Y0d4XtDDYkS-vQSOjzx2pkYd zg)kV}G?*bQ0~bjMqe1Z$RPIS41A`!tZOqXibL62+nh2w9hqFb?;U1?3_R0$O;u(cJ z&lvdM3h;et;4|iNk~?%z_S{05Gy_(!vS#Ts%(f?-ZF`t)fo2pcFfeccX*UIniM%`x z#u5hN z4-hyjl9;9tvsG3=Q1NP;gG))hQo~vY(PFX uy-?qS?S<)aoTZRLtR9e?K=w2ySqQLT+5r@SxCf^0Ad%`AlX05|G7|s^=YF67 diff --git a/test/Bitcode/invalid.test b/test/Bitcode/invalid.test index 59543d2ae79..9cab227ab19 100644 --- a/test/Bitcode/invalid.test +++ b/test/Bitcode/invalid.test @@ -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 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 -- 2.34.1