]> granicus.if.org Git - clang/commitdiff
Add null pointer check.
authorTed Kremenek <kremenek@apple.com>
Thu, 2 Apr 2009 03:30:55 +0000 (03:30 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 2 Apr 2009 03:30:55 +0000 (03:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68281 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BugReporter.cpp

index 5047e718049aa02fa058a0ee553a4d11d8a1f73f..7637a1614c2569729fb1166dd208e6e96d7ca682 100644 (file)
@@ -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;
       }