diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-04-08 22:26:47 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-04-08 22:26:47 +0000 |
| commit | 912fa42dd999a49b9f5e33b14205a94ec56189d9 (patch) | |
| tree | cc3ceb215b5d63912b21be25c274a3f90abbc8d9 /llvm | |
| parent | 3396d7ef9d2fbebcf06552a517cdd1d86d777ac4 (diff) | |
| download | bcm5719-llvm-912fa42dd999a49b9f5e33b14205a94ec56189d9.tar.gz bcm5719-llvm-912fa42dd999a49b9f5e33b14205a94ec56189d9.zip | |
Fix BitstreamReader's GetCurrentBitNo to return the correct bit number, and stop JumpToBit from covering up its mistakes
llvm-svn: 68648
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Bitcode/BitstreamReader.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/include/llvm/Bitcode/BitstreamReader.h b/llvm/include/llvm/Bitcode/BitstreamReader.h index d64c0dc2ac6..d738628efbd 100644 --- a/llvm/include/llvm/Bitcode/BitstreamReader.h +++ b/llvm/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)); } } |

