File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -69,12 +69,12 @@ static unsigned getLength(const Expr *E,
6969 if (const auto *LengthDRE = dyn_cast<DeclRefExpr>(E))
7070 if (const auto *LengthVD = dyn_cast<VarDecl>(LengthDRE->getDecl ()))
7171 if (!isa<ParmVarDecl>(LengthVD))
72- if (const Expr *LengthInit = LengthVD->getInit ())
73- if ( !LengthInit->isValueDependent ()) {
74- Expr::EvalResult Length;
75- if (LengthInit->EvaluateAsInt (Length, *Result.Context ))
76- return Length.Val .getInt ().getZExtValue ();
77- }
72+ if (const Expr *LengthInit = LengthVD->getInit ();
73+ LengthInit && !LengthInit->isValueDependent ()) {
74+ Expr::EvalResult Length;
75+ if (LengthInit->EvaluateAsInt (Length, *Result.Context ))
76+ return Length.Val .getInt ().getZExtValue ();
77+ }
7878
7979 if (const auto *LengthIL = dyn_cast<IntegerLiteral>(E))
8080 return LengthIL->getValue ().getZExtValue ();
You can’t perform that action at this time.
0 commit comments