mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-09 10:31:14 +00:00
several bitfixes to JumpToBit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36616 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
866971474c
commit
2bbb703e4f
@ -93,16 +93,19 @@ public:
|
|||||||
|
|
||||||
/// JumpToBit - Reset the stream to the specified bit number.
|
/// JumpToBit - Reset the stream to the specified bit number.
|
||||||
void JumpToBit(uint64_t BitNo) {
|
void JumpToBit(uint64_t BitNo) {
|
||||||
unsigned WordNo = BitNo/32;
|
unsigned ByteNo = (BitNo/8) & ~3;
|
||||||
unsigned WordBitNo = BitNo & 31;
|
unsigned WordBitNo = BitNo & 31;
|
||||||
assert(WordNo < (unsigned)(LastChar-FirstChar) && "Invalid location");
|
assert(ByteNo < (unsigned)(LastChar-FirstChar) && "Invalid location");
|
||||||
|
|
||||||
// Move the cursor to the right word.
|
// Move the cursor to the right word.
|
||||||
NextChar = FirstChar+WordNo;
|
NextChar = FirstChar+ByteNo;
|
||||||
BitsInCurWord = 0;
|
BitsInCurWord = 0;
|
||||||
|
|
||||||
// Skip over any bits that are already consumed.
|
// Skip over any bits that are already consumed.
|
||||||
if (WordBitNo) Read(WordBitNo);
|
if (WordBitNo) {
|
||||||
|
NextChar -= 4;
|
||||||
|
Read(WordBitNo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// GetAbbrevIDWidth - Return the number of bits used to encode an abbrev #.
|
/// GetAbbrevIDWidth - Return the number of bits used to encode an abbrev #.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user