]> granicus.if.org Git - clang/commitdiff
BugReporter (extensive diagnostics): Do not include the range of target '}'
authorTed Kremenek <kremenek@apple.com>
Fri, 15 May 2009 02:46:13 +0000 (02:46 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 15 May 2009 02:46:13 +0000 (02:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71832 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BugReporter.cpp

index 4a4784afe981b147e2ff98064d0c19c9baafae5f..eedc18f56df655ba232677710a920950c68d629a 100644 (file)
@@ -865,7 +865,7 @@ class VISIBILITY_HIDDEN EdgeBuilder {
   void popLocation() {
     if (!CLocs.back().isDead() && CLocs.back().asLocation().isFileID()) {
       // For contexts, we only one the first character as the range.
-      rawAddEdge( cleanUpLocation(CLocs.back(), true));
+      rawAddEdge(cleanUpLocation(CLocs.back(), true));
     }
     CLocs.pop_back();
   }
@@ -1139,14 +1139,16 @@ static void GenerateExtensivePathDiagnostic(PathDiagnostic& PD,
           
           PathDiagnosticEventPiece *p =
             new PathDiagnosticEventPiece(L,
-                                         "Looping back to the head of the loop");
+                                        "Looping back to the head of the loop");
           
           EB.addEdge(p->getLocation(), true);
           PD.push_front(p);
           
           if (CS) {
-            EB.addEdge(PathDiagnosticLocation(CS->getRBracLoc(),
-                                              PDB.getSourceManager()));                        
+            PathDiagnosticLocation BL(CS->getRBracLoc(),
+                                      PDB.getSourceManager());
+            BL = PathDiagnosticLocation(BL.asLocation());
+            EB.addEdge(BL);
           }
         }