diff options
Diffstat (limited to 'lib/Checker/BugReporter.cpp')
-rw-r--r-- | lib/Checker/BugReporter.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Checker/BugReporter.cpp b/lib/Checker/BugReporter.cpp index 5043d90526..a3f4f032a2 100644 --- a/lib/Checker/BugReporter.cpp +++ b/lib/Checker/BugReporter.cpp @@ -1165,15 +1165,15 @@ static void GenerateExtensivePathDiagnostic(PathDiagnostic& PD, } if (const BlockEntrance *BE = dyn_cast<BlockEntrance>(&P)) { - if (const Stmt* S = BE->getFirstStmt()) { - if (IsControlFlowExpr(S)) { - // Add the proper context for '&&', '||', and '?'. - EB.addContext(S); - } - else - EB.addExtendedContext(PDB.getEnclosingStmtLocation(S).asStmt()); + if (CFGStmt S = BE->getFirstElement().getAs<CFGStmt>()) { + if (IsControlFlowExpr(S)) { + // Add the proper context for '&&', '||', and '?'. + EB.addContext(S); + } + else + EB.addExtendedContext(PDB.getEnclosingStmtLocation(S).asStmt()); } - + break; } } while (0); |