[cfe-commits] r167361 - /cfe/trunk/lib/Frontend/TextDiagnostic.cpp

Seth Cantrell seth.cantrell at gmail.com
Sat Nov 3 14:21:18 PDT 2012


Author: socantre
Date: Sat Nov  3 16:21:17 2012
New Revision: 167361

URL: http://llvm.org/viewvc/llvm-project?rev=167361&view=rev
Log:
don't step into the middle of multibyte sequences

Modified:
    cfe/trunk/lib/Frontend/TextDiagnostic.cpp

Modified: cfe/trunk/lib/Frontend/TextDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnostic.cpp?rev=167361&r1=167360&r2=167361&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnostic.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnostic.cpp Sat Nov  3 16:21:17 2012
@@ -418,7 +418,7 @@
     bool ExpandedRegion = false;
 
     if (SourceStart>0) {
-      unsigned NewStart = SourceStart-1;
+      unsigned NewStart = map.startOfPreviousColumn(SourceStart);
 
       // Skip over any whitespace we see here; we're looking for
       // another bit of interesting text.
@@ -445,7 +445,7 @@
     }
 
     if (SourceEnd<SourceLine.size()) {
-      unsigned NewEnd = SourceEnd+1;
+      unsigned NewEnd = map.startOfNextColumn(SourceEnd);
 
       // Skip over any whitespace we see here; we're looking for
       // another bit of interesting text.





More information about the cfe-commits mailing list