]> granicus.if.org Git - clang/commitdiff
Fixed range highlighting bug in HTML diagnostics.
authorTed Kremenek <kremenek@apple.com>
Fri, 18 Apr 2008 05:01:33 +0000 (05:01 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 18 Apr 2008 05:01:33 +0000 (05:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49893 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/HTMLDiagnostics.cpp

index 4d95c17b67041e00b4378fa5230916da448b4ebb..dbc156780f8d04397513fb867ef936e8fe8da04a 100644 (file)
@@ -326,15 +326,13 @@ void HTMLDiagnostics::HighlightRange(Rewriter& R, SourceRange Range) {
 
   if (EndColNo) {
     // Add in the length of the token, so that we cover multi-char tokens.
-    EndColNo += Lexer::MeasureTokenLength(Range.getEnd(), SM);
+    EndColNo += Lexer::MeasureTokenLength(Range.getEnd(), SM) - 1;
   }
   
   // Highlight the range.  Make the span tag the outermost tag for the
   // selected range.
     
-  SourceLocation E = LogicalEnd.getFileLocWithOffset(OldEndColNo > EndColNo
-                                                     ? -(OldEndColNo - EndColNo)
-                                                     : EndColNo - OldEndColNo);
+  SourceLocation E = LogicalEnd.getFileLocWithOffset(EndColNo - OldEndColNo);
   
   html::HighlightRange(R, LogicalStart, E,
                        "<span class=\"mrange\">", "</span>");