Skip to content

Commit

Permalink
Scope fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olabetskyi committed Jun 7, 2024
1 parent 48e987b commit 0e8e004
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/checkother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,7 @@ void CheckOther::checkRedundantAssignment()
const Token * tokenToCheck = tok->astOperand1();

// Check if we are working with union
const Token * tempToken = tokenToCheck;
while (Token::Match(tempToken, ".|->")) {
for (const Token* tempToken = tokenToCheck; Token::Match(tempToken, ".");) {
tempToken = tempToken->astOperand1();
if (tempToken && tempToken->variable() && tempToken->variable()->type() && tempToken->variable()->type()->isUnionType())
tokenToCheck = tempToken;
Expand Down

0 comments on commit 0e8e004

Please sign in to comment.