aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-03 07:33:55 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-03 07:33:55 +0000
commit70d1722c90e34c1a86c02b93e35f6a763548acb6 (patch)
treee2533171d9aa19e1b32694c1866a62045555ef9d /lib/Analysis/BugReporter.cpp
parent9c600ff132deff36ac43fff2bc6b50a2c0fc8133 (diff)
Handle the case when getEndPath() returns NULL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r--lib/Analysis/BugReporter.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index ef919a3736..c5a59e20d8 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -64,7 +64,11 @@ void BugReporter::GeneratePathDiagnostic(PathDiagnostic& PD, ASTContext& Ctx,
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 @@ void BugReporter::EmitPathWarning(Diagnostic& Diag,
PathDiagnostic D(B.getName());
GeneratePathDiagnostic(D, Ctx, B, G, N);
- PDC->HandlePathDiagnostic(D);
+
+ if (!D.empty())
+ PDC->HandlePathDiagnostic(D);
}