[cfe-dev] BitstreamReader::GetCurrentBitNo() counterintuitive

Zhongxing Xu xuzhongxing at gmail.com
Tue Dec 23 16:45:50 PST 2008


On Wed, Dec 24, 2008 at 3:39 AM, Chris Lattner <clattner at apple.com> wrote:

>
> On Dec 23, 2008, at 12:36 AM, Zhongxing Xu wrote:
>
>  As the comments said, BitstreamReader::GetCurrentBitNo() should return the
>> bit # of the bit we are reading. But the current implementation actually
>> return 4 more bytes than the bit we are reading. It calculate the bit number
>> by
>>
>> (NextChar-FirstChar)*8 + ((32-BitsInCurWord) & 31);
>>
>> But 'NextChar' is already after the word that we are reading. I propose to
>> fix this by the following patch.
>>
>
> Hi Zhongxing,
>
> This is ok as long as it doesn't cause any regressions in the *llvm*
> dejagnu regression tests, thanks!


OK.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20081224/1d1e7a01/attachment.html>


More information about the cfe-dev mailing list