Allow jumping to the end of a bitstream while reading

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69145 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Douglas Gregor 2009-04-15 04:53:47 +00:00
parent dd9f523997
commit 37a4d8dbbb

View File

@ -122,7 +122,7 @@ public:
void JumpToBit(uint64_t BitNo) {
uintptr_t ByteNo = uintptr_t(BitNo/8) & ~3;
uintptr_t WordBitNo = uintptr_t(BitNo) & 31;
assert(ByteNo < (uintptr_t)(LastChar-FirstChar) && "Invalid location");
assert(ByteNo <= (uintptr_t)(LastChar-FirstChar) && "Invalid location");
// Move the cursor to the right word.
NextChar = FirstChar+ByteNo;