Skip to content

Commit

Permalink
no expression -> aliased
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Dec 5, 2023
1 parent 8635a36 commit 400bf2c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2639,11 +2639,8 @@ bool isVariableChanged(const Token *tok, int indirect, const Settings *settings,
return true;

const Token *ftok = tok2;
while (ftok && (!Token::Match(ftok, "[({]") || ftok->isCast())) {
if (ftok->isInitComma())
return false;
while (ftok && (!Token::Match(ftok, "[({]") || ftok->isCast()))
ftok = ftok->astParent();
}

if (ftok && Token::Match(ftok->link(), ")|} !!{")) {
const Token * ptok = tok2;
Expand Down Expand Up @@ -2809,7 +2806,8 @@ Token* findVariableChanged(Token *start, const Token *end, int indirect, const n
if (depth < 0)
return start;
auto getExprTok = memoize([&] {
return findExpression(start, exprid);
auto e = findExpression(start, exprid);
return e ? e : start;
});
for (Token *tok = start; tok != end; tok = tok->next()) {
if (isExpressionChangedAt(getExprTok, tok, indirect, exprid, globalvar, settings, cpp, depth))
Expand Down

0 comments on commit 400bf2c

Please sign in to comment.