Skip to content

Commit c25f285

Browse files
Update astutils.cpp
1 parent 477f2b9 commit c25f285

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/astutils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2636,7 +2636,8 @@ bool isVariableChanged(const Token *tok, int indirect, const Settings &settings,
26362636
while ((tok2->astParent() && tok2->astParent()->isUnaryOp("*")) ||
26372637
(Token::simpleMatch(tok2->astParent(), ".") && !Token::Match(tok2->astParent()->astParent(), "[(,]")) ||
26382638
(tok2->astParent() && tok2->astParent()->isUnaryOp("&") && Token::simpleMatch(tok2->astParent()->astParent(), ".") && tok2->astParent()->astParent()->originalName()=="->") ||
2639-
(Token::simpleMatch(tok2->astParent(), "[") && tok2 == tok2->astParent()->astOperand1())) {
2639+
(Token::simpleMatch(tok2->astParent(), "[") && tok2 == tok2->astParent()->astOperand1()) ||
2640+
(Token::simpleMatch(tok2->astParent(), "(") && tok2->astParent()->isCast())) {
26402641
if (tok2->astParent() && (tok2->astParent()->isUnaryOp("*") || (astIsLHS(tok2) && tok2->astParent()->originalName() == "->" && !hasOverloadedMemberAccess(tok2))))
26412642
derefs++;
26422643
if (derefs > indirect)

0 commit comments

Comments
 (0)