summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Analysis/BugReporter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Analysis/BugReporter.cpp b/clang/lib/Analysis/BugReporter.cpp
index 5047e718049..7637a1614c2 100644
--- a/clang/lib/Analysis/BugReporter.cpp
+++ b/clang/lib/Analysis/BugReporter.cpp
@@ -789,7 +789,8 @@ static void GenExtAddEdge(PathDiagnostic& PD,
if (const Stmt *PS = PrevLoc.asStmt())
if (const Stmt *NS = NewLoc.asStmt()) {
const Stmt *parentPS = PDB.getParent(PS);
- if (isa<CompoundStmt>(parentPS) && parentPS == PDB.getParent(NS))
+ if (parentPS && isa<CompoundStmt>(parentPS) &&
+ parentPS == PDB.getParent(NS))
return;
}
OpenPOWER on IntegriCloud