Skip to content

Commit b39ef15

Browse files
aadanendanmar
andauthored
Update lib/checkuninitvar.cpp
apply simplification Co-authored-by: Daniel Marjamäki <daniel.marjamaki@gmail.com>
1 parent b7db371 commit b39ef15

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/checkuninitvar.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ const Token* CheckUninitVarImpl::isVariableUsage(const Token *vartok, const Libr
12951295
}
12961296
if (alloc != NO_ALLOC && astIsRhs(valueExpr))
12971297
return nullptr;
1298-
} else if (tok->astParent() && (tok->astParent()->isAssignmentOp() || tok->astParent()->isIncDecOp())) {
1298+
} else if (Token::Match(tok->astParent(), "%assign%|++|--")) {
12991299
// NO_ALLOC -> no matter what we read the uninitialized memory.
13001300
// pointer/array -> safe, as long as we don't dereference
13011301
bool isPtr = pointer;

0 commit comments

Comments
 (0)