mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
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
This commit is contained in:
@ -115,7 +115,7 @@ public:
|
|||||||
|
|
||||||
/// GetCurrentBitNo - Return the bit # of the bit we are reading.
|
/// GetCurrentBitNo - Return the bit # of the bit we are reading.
|
||||||
uint64_t GetCurrentBitNo() const {
|
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.
|
/// JumpToBit - Reset the stream to the specified bit number.
|
||||||
@ -131,7 +131,6 @@ public:
|
|||||||
|
|
||||||
// Skip over any bits that are already consumed.
|
// Skip over any bits that are already consumed.
|
||||||
if (WordBitNo) {
|
if (WordBitNo) {
|
||||||
NextChar -= 4;
|
|
||||||
Read(static_cast<unsigned>(WordBitNo));
|
Read(static_cast<unsigned>(WordBitNo));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user