aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r--lib/Analysis/BugReporter.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 2ae0960206..db979fafdb 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -69,8 +69,26 @@ void BugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, ASTContext& Ctx,
SourceManager& SMgr = Ctx.getSourceManager();
-
llvm::OwningPtr<ExplodedGraph<GRExprEngine> > GTrim(G.Trim(&N, &N+1));
+
+ // Find the sink in the trimmed graph.
+ // FIXME: Should we eventually have a sink iterator?
+
+ ExplodedNode<ValueState>* NewN = 0;
+
+ for (ExplodedGraph<GRExprEngine>::node_iterator
+ I = GTrim->nodes_begin(), E = GTrim->nodes_end(); I != E; ++I) {
+
+ if (I->isSink()) {
+ NewN = &*I;
+ break;
+ }
+ }
+
+ assert (NewN);
+ assert (NewN->getLocation() == N->getLocation());
+
+ N = NewN;
while (!N->pred_empty()) {