diff options
author | Douglas Gregor <doug.gregor@gmail.com> | 2009-04-08 22:26:47 +0000 |
---|---|---|
committer | Douglas Gregor <doug.gregor@gmail.com> | 2009-04-08 22:26:47 +0000 |
commit | 5a58b649f38f16c4994ae414e2380c82f8477802 (patch) | |
tree | 6600daae4d86f07f4766ef72f36ff3e6144dd4dc /include/llvm/Bitcode | |
parent | 6e199966ef24f2e79a85572b91303a371c76f071 (diff) | |
download | external_llvm-5a58b649f38f16c4994ae414e2380c82f8477802.zip external_llvm-5a58b649f38f16c4994ae414e2380c82f8477802.tar.gz external_llvm-5a58b649f38f16c4994ae414e2380c82f8477802.tar.bz2 |
Fix BitstreamReader's GetCurrentBitNo to return the correct bit number, and stop JumpToBit from covering up its mistakes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68648 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Bitcode')
-rw-r--r-- | include/llvm/Bitcode/BitstreamReader.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index d64c0dc..d738628 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -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)); } } |