@@ -1013,7 +1013,7 @@ static const Token * getVariableInitExpression(const Variable * var)
10131013
10141014const Token* isInLoopCondition (const Token* tok)
10151015{
1016- const Token* top = tok->astTop ();
1016+ const Token* top = tok->astTop (true );
10171017 return Token::Match (top->previous (), " for|while (" ) ? top : nullptr ;
10181018}
10191019
@@ -2243,12 +2243,12 @@ bool isReturnScope(const Token* const endToken, const Library& library, const To
22432243 !Token::findsimplematch (prev->link (), " break" , prev)) {
22442244 return isReturnScope (prev, library, unknownFunc, functionScope);
22452245 }
2246- if (isEscaped (prev->link ()->astTop (), functionScope, library))
2246+ if (isEscaped (prev->link ()->astTop (true ), functionScope, library))
22472247 return true ;
22482248 if (Token::Match (prev->link ()->previous (), " [;{}] {" ))
22492249 return isReturnScope (prev, library, unknownFunc, functionScope);
22502250 } else if (Token::simpleMatch (prev, " ;" )) {
2251- if (prev->tokAt (-2 ) && hasNoreturnFunction (prev->tokAt (-2 )->astTop (), library, unknownFunc))
2251+ if (prev->tokAt (-2 ) && hasNoreturnFunction (prev->tokAt (-2 )->astTop (true ), library, unknownFunc))
22522252 return true ;
22532253 // Unknown symbol
22542254 if (Token::Match (prev->tokAt (-2 ), " ;|}|{ %name% ;" ) && prev->previous ()->isIncompleteVar ()) {
@@ -2257,9 +2257,9 @@ bool isReturnScope(const Token* const endToken, const Library& library, const To
22572257 return false ;
22582258 }
22592259 if (Token::simpleMatch (prev->previous (), " ) ;" ) && prev->linkAt (-1 ) &&
2260- isEscaped (prev->linkAt (-1 )->astTop (), functionScope, library))
2260+ isEscaped (prev->linkAt (-1 )->astTop (true ), functionScope, library))
22612261 return true ;
2262- if (isEscaped (prev->previous ()->astTop (), functionScope, library))
2262+ if (isEscaped (prev->previous ()->astTop (true ), functionScope, library))
22632263 return true ;
22642264 // return/goto statement
22652265 prev = prev->previous ();
0 commit comments