diff --git a/lib/astutils.cpp b/lib/astutils.cpp index 3db38c1cf..fcf9276e9 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -2225,7 +2225,7 @@ bool isVariableChanged(const Token *tok, int indirect, const Settings *settings, derefs++; if (derefs > indirect) break; - if ((tok2->astParent() && tok2->astParent()->isUnaryOp("&") && Token::simpleMatch(tok2->astParent()->astParent(), ".") && tok2->astParent()->astParent()->originalName()=="->")) + if (tok2->astParent() && tok2->astParent()->isUnaryOp("&") && Token::simpleMatch(tok2->astParent()->astParent(), ".") && tok2->astParent()->astParent()->originalName()=="->") tok2 = tok2->astParent(); tok2 = tok2->astParent(); } @@ -2238,7 +2238,7 @@ bool isVariableChanged(const Token *tok, int indirect, const Settings *settings, auto skipRedundantPtrOp = [](const Token* tok, const Token* parent) { const Token* gparent = parent ? parent->astParent() : nullptr; - while (parent && gparent && ((parent->isUnaryOp("*") && gparent->isUnaryOp("&")) || ((parent->isUnaryOp("&") && gparent->isUnaryOp("*"))))) { + while (parent && gparent && ((parent->isUnaryOp("*") && gparent->isUnaryOp("&")) || (parent->isUnaryOp("&") && gparent->isUnaryOp("*")))) { tok = gparent; parent = gparent->astParent(); if (parent)