Skip to content

Commit

Permalink
Address reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Aug 7, 2023
1 parent 985352d commit 4650783
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2348,7 +2348,7 @@ bool isVariableChangedByFunctionCall(const Token *tok, int indirect, const Setti
indirect++;

const bool deref = tok->astParent() && tok->astParent()->isUnaryOp("*");
if (deref)
if (deref && indirect > 0)
indirect--;

int argnr;
Expand Down Expand Up @@ -2580,6 +2580,8 @@ bool isVariableChanged(const Token *tok, int indirect, const Settings *settings,
}

const Token *parent = tok2->astParent();
while (Token::Match(parent, ".|::"))
parent = parent->astParent();
if (parent && parent->tokType() == Token::eIncDecOp && (indirect == 0 || tok2 != tok))
return true;

Expand Down

0 comments on commit 4650783

Please sign in to comment.