diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-03 07:33:55 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-03 07:33:55 +0000 |
commit | ca40664275eb6c465b924f6745afb40cd696b6a0 (patch) | |
tree | 5789d48763e9a1a8f9d3a9fba36a31303703eee0 /clang/lib/Analysis/BugReporter.cpp | |
parent | 4d26d194e4977fa604899e765a1bf194a30957c6 (diff) | |
download | bcm5719-llvm-ca40664275eb6c465b924f6745afb40cd696b6a0.tar.gz bcm5719-llvm-ca40664275eb6c465b924f6745afb40cd696b6a0.zip |
Handle the case when getEndPath() returns NULL.
llvm-svn: 49155
Diffstat (limited to 'clang/lib/Analysis/BugReporter.cpp')
-rw-r--r-- | clang/lib/Analysis/BugReporter.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp index ef919a37366..c5a59e20d87 100644 --- a/clang/lib/Analysis/BugReporter.cpp +++ b/clang/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); } |