aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/BugReporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index 9191fdea2d..0729b5e842 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -1523,9 +1523,9 @@ static bool GenerateExtensivePathDiagnostic(PathDiagnostic& PD,
}
if (Optional<BlockEntrance> BE = P.getAs<BlockEntrance>()) {
- CFGElement First = BE->getFirstElement();
- if (CFGStmt S = First.getAs<CFGStmt>()) {
- const Stmt *stmt = S.getStmt();
+ Optional<CFGElement> First = BE->getFirstElement();
+ if (Optional<CFGStmt> S = First ? First->getAs<CFGStmt>() : None) {
+ const Stmt *stmt = S->getStmt();
if (IsControlFlowExpr(stmt)) {
// Add the proper context for '&&', '||', and '?'.
EB.addContext(stmt);