File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -556,14 +556,15 @@ ValueFlow::Value CheckBufferOverrunImpl::getBufferSize(const Token *bufTok) cons
556556{
557557 if (!bufTok->valueType ())
558558 return ValueFlow::Value (-1 );
559- if (bufTok->isUnaryOp (" &" ))
560- bufTok = bufTok->astOperand1 ();
561559 const Token* varTok = bufTok;
562- if (Token::simpleMatch (bufTok, " [" )) {
563- const Token* index = bufTok->astOperand2 ();
564- if (!(index && index->hasKnownIntValue () && index->getKnownIntValue () == 0 ))
565- return ValueFlow::Value (-1 );
566- varTok = varTok->astOperand1 ();
560+ if (bufTok->isUnaryOp (" &" )) {
561+ bufTok = bufTok->astOperand1 ();
562+ if (Token::simpleMatch (bufTok, " [" )) {
563+ const Token* index = bufTok->astOperand2 ();
564+ if (!(index && index->hasKnownIntValue () && index->getKnownIntValue () == 0 ))
565+ return ValueFlow::Value (-1 );
566+ varTok = bufTok->astOperand1 ();
567+ }
567568 }
568569 const Variable *var = varTok->variable ();
569570
You can’t perform that action at this time.
0 commit comments