Add another null pointer check. Simplify condition.
llvm-svn: 68283
This commit is contained in:
parent
7f905c2f0d
commit
a2a735e7fa
|
|
@ -806,17 +806,18 @@ static void GenExtAddEdge(PathDiagnostic& PD,
|
|||
// FIXME: We need a version of getParent that ignores '()' and casts.
|
||||
const Stmt *parentY = PDB.getParent(Y.asStmt());
|
||||
|
||||
if (IsControlFlowExpr(parentX)) {
|
||||
if (IsControlFlowExpr(parentY) && parentX == parentY) {
|
||||
if (parentX && IsControlFlowExpr(parentX)) {
|
||||
if (parentX == parentY)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
if (const Stmt *grandparentX = PDB.getParent(parentX)) {
|
||||
const PathDiagnosticLocation &W =
|
||||
PDB.getEnclosingStmtLocation(PDB.getParent(parentX));
|
||||
PDB.getEnclosingStmtLocation(grandparentX);
|
||||
|
||||
if (W != Y) X = W;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (X != Y && PrevLoc.asLocation() != X.asLocation()) {
|
||||
PD.push_front(new PathDiagnosticControlFlowPiece(X, PrevLoc));
|
||||
|
|
|
|||
Loading…
Reference in New Issue