Skip to content

Commit

Permalink
Update checkclass.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Aug 29, 2024
1 parent 4ba0767 commit 6275aa2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3327,8 +3327,14 @@ static const Variable* getSingleReturnVar(const Scope* scope) {
if (!start->astOperand1() || start->str() != "return")
return nullptr;
const Token* tok = start->astOperand1();
if (tok->str() == ".")
if (tok->str() == ".") {
const Token* top = tok->astOperand1();
while (Token::Match(top, "[[.]"))
top = top->astOperand1();
if (!Token::Match(top, "%var%"))
return nullptr;
tok = tok->astOperand2();
}
return tok->variable();
}

Expand Down

0 comments on commit 6275aa2

Please sign in to comment.