2012/12/17 Nico Weber <[email protected]>: > 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 <[email protected]> > 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 >> [email protected] >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
