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

Ted Kremenek kremenek at apple.com
Wed Apr 23 16:04:32 PDT 2008


Author: kremenek
Date: Wed Apr 23 18:04:32 2008
New Revision: 50195

URL: http://llvm.org/viewvc/llvm-project?rev=50195&view=rev
Log:
Fix minor regression in bug report generation.

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=50195&r1=50194&r2=50195&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Wed Apr 23 18:04:32 2008
@@ -165,19 +165,20 @@
                                      GTrim->getContext());
                                      
                                      
-  ExplodedNode<ValueState>* Last = 0;
+  ExplodedNode<ValueState> *Last = 0, *First = 0;
 
   while (N) {
     ExplodedNode<ValueState>* NewN =
       G->getNode(N->getLocation(), N->getState());
     
+    if (!First) First = NewN;
     if (Last) Last->addPredecessor(NewN);
     
     Last = NewN;
     N = N->pred_empty() ? 0 : *(N->pred_begin());
   }
   
-  return std::make_pair(G, Last);
+  return std::make_pair(G, First);
 }
 
 void BugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,





More information about the cfe-commits mailing list