Fix BitstreamReader's GetCurrentBitNo to return the correct bit number, and stop...
authorDouglas Gregor <dgregor@apple.com>
Wed, 8 Apr 2009 22:26:47 +0000 (22:26 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 8 Apr 2009 22:26:47 +0000 (22:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68648 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Bitcode/BitstreamReader.h

index d64c0dc2ac61e5cdbb6cb689ece6622e720cdac9..d738628efbdc89a55d27b4145beeee6650f6b5b2 100644 (file)
@@ -115,7 +115,7 @@ public:
 
   /// GetCurrentBitNo - Return the bit # of the bit we are reading.
   uint64_t GetCurrentBitNo() const {
-    return (NextChar-FirstChar)*CHAR_BIT + ((32-BitsInCurWord) & 31);
+    return (NextChar-FirstChar)*CHAR_BIT - BitsInCurWord;
   }
 
   /// JumpToBit - Reset the stream to the specified bit number.
@@ -131,7 +131,6 @@ public:
 
     // Skip over any bits that are already consumed.
     if (WordBitNo) {
-      NextChar -= 4;
       Read(static_cast<unsigned>(WordBitNo));
     }
   }