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 6, 2023
1 parent ae44419 commit 686b01d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2837,10 +2837,9 @@ bool isExpressionChanged(const Token* expr, const Token* start, const Token* end
if (vt->type == ValueType::ITERATOR)
++indirect;
}
if (Token::Match(tok->astParent(), "%cop%") && tok2->astParent() && tok2->astParent()->isIncDecOp())
indirect = 0;
if (isExpressionChangedAt(tok, tok2, indirect, global, settings, cpp, depth))
return true;
for (int i = 0; i <= indirect; ++i)
if (isExpressionChangedAt(tok, tok2, i, global, settings, cpp, depth))
return true;
}
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3219,7 +3219,7 @@ struct ExpressionAnalyzer : SingleValueFlowAnalyzer {
}

Action isAliasModified(const Token* tok, int indirect) const override {
if (value.isSymbolicValue() && tok->astParent() && tok->astParent()->isIncDecOp() && Token::Match(value.tokvalue->astParent(), "%cop%"))
if (value.isSymbolicValue() && tok->exprId() == value.tokvalue->exprId())
indirect = 0;
return SingleValueFlowAnalyzer::isAliasModified(tok, indirect);
}
Expand Down

0 comments on commit 686b01d

Please sign in to comment.