Allow jumping to the end of a bitstream while reading
authorDouglas Gregor <dgregor@apple.com>
Wed, 15 Apr 2009 04:53:47 +0000 (04:53 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 15 Apr 2009 04:53:47 +0000 (04:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69145 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Bitcode/BitstreamReader.h

index d738628efbdc89a55d27b4145beeee6650f6b5b2..7ff4e26fd8cd43883c71a239a28faa99d67dc5fc 100644 (file)
@@ -122,7 +122,7 @@ public:
   void JumpToBit(uint64_t BitNo) {
     uintptr_t ByteNo = uintptr_t(BitNo/8) & ~3;
     uintptr_t WordBitNo = uintptr_t(BitNo) & 31;
-    assert(ByteNo < (uintptr_t)(LastChar-FirstChar) && "Invalid location");
+    assert(ByteNo <= (uintptr_t)(LastChar-FirstChar) && "Invalid location");
 
     // Move the cursor to the right word.
     NextChar = FirstChar+ByteNo;