Skip to content

Commit 272eb17

Browse files
committed
Fix nullptr crash
1 parent 3585617 commit 272eb17

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ class UncountedLambdaCapturesChecker
7272
auto *VD = dyn_cast_or_null<VarDecl>(DRE->getDecl());
7373
if (!VD)
7474
return true;
75-
auto *Init = VD->getInit()->IgnoreParenCasts();
76-
auto *L = dyn_cast_or_null<LambdaExpr>(Init);
75+
auto *Init = VD->getInit();
76+
if (!Init)
77+
return true;
78+
auto *L = dyn_cast_or_null<LambdaExpr>(Init->IgnoreParenCasts());
7779
if (!L)
7880
return true;
7981
Checker->visitLambdaExpr(L, shouldCheckThis());

0 commit comments

Comments
 (0)