diff options
author | Seth Cantrell <seth.cantrell@gmail.com> | 2012-11-03 21:21:17 +0000 |
---|---|---|
committer | Seth Cantrell <seth.cantrell@gmail.com> | 2012-11-03 21:21:17 +0000 |
commit | 9cffb4a9ae548245ede15850cb96dfedf56255fe (patch) | |
tree | 26a69de82fe5fbc26bcba9f404c2d5f42d4be6a9 /lib/Frontend/TextDiagnostic.cpp | |
parent | eaa5a2b5e099bf29856bc88b03cd7c9d473f671d (diff) |
don't step into the middle of multibyte sequences
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/TextDiagnostic.cpp')
-rw-r--r-- | lib/Frontend/TextDiagnostic.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Frontend/TextDiagnostic.cpp b/lib/Frontend/TextDiagnostic.cpp index 0eb3d60e0b..ca55197f90 100644 --- a/lib/Frontend/TextDiagnostic.cpp +++ b/lib/Frontend/TextDiagnostic.cpp @@ -418,7 +418,7 @@ static void selectInterestingSourceRegion(std::string &SourceLine, 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 @@ static void selectInterestingSourceRegion(std::string &SourceLine, } 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. |