diff options
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r-- | lib/Analysis/BugReporter.cpp | 10 |
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); } |