summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Analysis/BugReporter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp
index d137cff3e7b..33633736b1d 100644
--- a/clang/lib/Analysis/BugReporter.cpp
+++ b/clang/lib/Analysis/BugReporter.cpp
@@ -165,19 +165,20 @@ MakeReportGraph(ExplodedGraph<ValueState>* G, ExplodedNode<ValueState>* N) {
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,
OpenPOWER on IntegriCloud