Skip to content
Snippets Groups Projects
Commit ca406642 authored by Ted Kremenek's avatar Ted Kremenek
Browse files

Handle the case when getEndPath() returns NULL.

llvm-svn: 49155
parent 4d26d194
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment