[cfe-commits] r49155 - /cfe/trunk/lib/Analysis/BugReporter.cpp

Ted Kremenek kremenek at apple.com
Thu Apr 3 00:33:56 PDT 2008


Author: kremenek
Date: Thu Apr  3 02:33:55 2008
New Revision: 49155

URL: http://llvm.org/viewvc/llvm-project?rev=49155&view=rev
Log:
Handle the case when getEndPath() returns NULL.

Modified:
    cfe/trunk/lib/Analysis/BugReporter.cpp

Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=49155&r1=49154&r2=49155&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Thu Apr  3 02:33:55 2008
@@ -64,7 +64,11 @@
                                          const BugDescription& B,
                                          ExplodedGraph<GRExprEngine>& G,
                                          ExplodedNode<ValueState>* N) {
-  PD.push_back(B.getEndPath(Ctx, N));
+  
+  if (PathDiagnosticPiece* Piece = B.getEndPath(Ctx,N))
+    PD.push_back(Piece);
+  else
+    return;
   
   SourceManager& SMgr = Ctx.getSourceManager();
   
@@ -249,7 +253,9 @@
   
   PathDiagnostic D(B.getName());  
   GeneratePathDiagnostic(D, Ctx, B, G, N);
-  PDC->HandlePathDiagnostic(D);
+  
+  if (!D.empty())  
+    PDC->HandlePathDiagnostic(D);
 }
 
 





More information about the cfe-commits mailing list