Cppcheck self-check; use Token::simpleMatch

This commit is contained in:
Daniel Marjamäki 2021-05-24 21:14:54 +02:00
parent 4cccc710ef
commit b61eaec5b4
1 changed files with 1 additions and 1 deletions

View File

@ -1122,7 +1122,7 @@ const Token* CheckUninitVar::isVariableUsage(const Token *vartok, bool pointer,
derefValue = valueExpr; derefValue = valueExpr;
while (Token::Match(derefValue->astParent(), "+|-|*|[|.") || while (Token::Match(derefValue->astParent(), "+|-|*|[|.") ||
(derefValue->astParent() && derefValue->astParent()->isCast()) || (derefValue->astParent() && derefValue->astParent()->isCast()) ||
(deref < arrayDim && Token::Match(derefValue->astParent(), "&") && derefValue->astParent()->isBinaryOp())) { (deref < arrayDim && Token::simpleMatch(derefValue->astParent(), "&") && derefValue->astParent()->isBinaryOp())) {
const Token * const derefValueParent = derefValue->astParent(); const Token * const derefValueParent = derefValue->astParent();
if (derefValueParent->str() == "*") { if (derefValueParent->str() == "*") {
if (derefValueParent->isUnaryOp("*")) if (derefValueParent->isUnaryOp("*"))