]> granicus.if.org Git - clang/commitdiff
Fixed a horrible bug in HTMLDiagnostics.cpp where bugs referencing source ranges...
authorTed Kremenek <kremenek@apple.com>
Sun, 2 Nov 2008 00:33:58 +0000 (00:33 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 2 Nov 2008 00:33:58 +0000 (00:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58550 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/HTMLDiagnostics.cpp

index 9bd62815e89644fec39df7b1cf2570771d9dd3f2..72870fefe0e965ce860062289f0b4b04ccac5983 100644 (file)
@@ -132,7 +132,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
   // Verify that the entire path is from the same FileID.
   for (PathDiagnostic::const_iterator I=D.begin(), E=D.end(); I != E; ++I) {
     
-    FullSourceLoc L = I->getLocation();
+    FullSourceLoc L = I->getLocation().getLogicalLoc();
     
     if (!L.isFileID())
       return; // FIXME: Emit a warning?
@@ -148,7 +148,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
     for (PathDiagnosticPiece::range_iterator RI=I->ranges_begin(),
                                              RE=I->ranges_end(); RI!=RE; ++RI) {
       
-      SourceLocation L = RI->getBegin();
+      SourceLocation L = SMgr.getLogicalLoc(RI->getBegin());
 
       if (!L.isFileID())
         return; // FIXME: Emit a warning?      
@@ -156,7 +156,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
       if (SMgr.getCanonicalFileID(L) != FileID)
         return; // FIXME: Emit a warning?
       
-      L = RI->getEnd();
+      L = SMgr.getLogicalLoc(RI->getEnd());
       
       if (!L.isFileID())
         return; // FIXME: Emit a warning?