|
|
On 3/26/19 6:46 AM, William F Pokorny wrote:
> On 3/25/19 7:41 PM, clipka wrote:
>> Am 25.03.2019 um 23:55 schrieb clipka:
>>
>>> If `Cond_Stack.back().PMac->endPosition == CurrentFilePosition()`
>>> throws an exception, it means either of two things:
>>>
>>> (A) The positions compared are from two different files, which means
>>> the calling code has failed to check whether it is even in the right
>>> file.
>>>
>>> (B) The line/column tracking is buggy, and yields different positions
>>> in different situations.
>>
>>
>> Well, looking at the code of `IsEndOfInvokedMacro()` again, it
>> _strongly_ reeks of scenario (A):
>>
>> return (Cond_Stack.back().PMac->endPosition ==
>> CurrentFilePosition()) &&
>> (Cond_Stack.back().PMac->source.fileName ==
>> mTokenizer.GetInputStreamName());
>>
>> should probably be swapped around, like so:
>>
>> return (Cond_Stack.back().PMac->source.fileName ==
>> mTokenizer.GetInputStreamName()) &&
>> (Cond_Stack.back().PMac->endPosition ==
>> CurrentFilePosition());
>>
>> so that the `LexemePosition` comparison operator is only invoked if
>> the file names match.
>>
...
Documenting that Christoph's suggested code change up top, which fixed
the bug with Warren's original test case and related test cases I
created, is NOT in the v38 master branch as of commit 74b3ebe0 (March 8,
2019).
Christoph - I think - planned to fix the core issue, but this has not
happened as of today so the bug persists.
Bill P.
Post a reply to this message
|
|