Skip to content

Commit eafdc58

Browse files
committed
Restrict loop
1 parent 338d58a commit eafdc58

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checkclass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2465,7 +2465,7 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, Member
24652465
lhs = lhs->astParent()->astParent();
24662466
if (lhs->str() == "&") {
24672467
const Token* parent = lhs->astParent();
2468-
while (parent) {
2468+
while (Token::Match(parent, "[+(]")) {
24692469
if (isNonConstPtrCast(parent))
24702470
return false;
24712471
parent = parent->astParent();

0 commit comments

Comments
 (0)