Fixed #2591 (cppcheck hangs with 100% cpu load ( class A : ))

This commit is contained in:
Daniel Marjamäki 2011-02-21 19:41:34 +01:00
parent 5984b6b53f
commit 55711698d0
1 changed files with 4 additions and 2 deletions

View File

@ -9237,9 +9237,11 @@ void Tokenizer::simplifyBorland()
// Remove Qt signals and slots
void Tokenizer::simplifyQtSignalsSlots()
{
Token *tok = _tokens;
while (NULL != (tok = const_cast<Token *>(Token::findmatch(tok, "class %var% :"))))
for (Token *tok = _tokens; tok; tok = tok->next())
{
if (!Token::Match(tok, "class %var% :"))
continue;
if (tok->previous() && tok->previous()->str() == "enum")
{
tok = tok->tokAt(2);