[cfe-commits] r170281 - /cfe/trunk/lib/Basic/SourceManager.cpp

NAKAMURA Takumi geek4civic at gmail.com
Sun Dec 16 20:58:11 PST 2012


2012/12/17 Nico Weber <thakis at chromium.org>:
> test?

I suppose --vg clang/test/Lexer had been detecting this. ;)
Of course, I don't oppose to add a testcase for PR14570.

...Takumi

> On Sat, Dec 15, 2012 at 9:58 PM, Craig Topper <craig.topper at gmail.com>
> wrote:
>>
>> Author: ctopper
>> Date: Sat Dec 15 23:58:32 2012
>> New Revision: 170281
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=170281&view=rev
>> Log:
>> Don't use SourceLineCache in getColumnNumber if LastLineNoResult is past
>> the end of the cache. Fixes PR14570.
>>
>> Modified:
>>     cfe/trunk/lib/Basic/SourceManager.cpp
>>
>> Modified: cfe/trunk/lib/Basic/SourceManager.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=170281&r1=170280&r2=170281&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/lib/Basic/SourceManager.cpp (original)
>> +++ cfe/trunk/lib/Basic/SourceManager.cpp Sat Dec 15 23:58:32 2012
>> @@ -1032,7 +1032,8 @@
>>    // See if we just calculated the line number for this FilePos and can
>> use
>>    // that to lookup the start of the line instead of searching for it.
>>    if (LastLineNoFileIDQuery == FID &&
>> -      LastLineNoContentCache->SourceLineCache != 0) {
>> +      LastLineNoContentCache->SourceLineCache != 0 &&
>> +      LastLineNoResult < LastLineNoContentCache->NumLines) {
>>      unsigned *SourceLineCache = LastLineNoContentCache->SourceLineCache;
>>      unsigned LineStart = SourceLineCache[LastLineNoResult - 1];
>>      unsigned LineEnd = SourceLineCache[LastLineNoResult];
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>



More information about the cfe-commits mailing list