From 55711698d0b51b881d13c4537914e86f43ffba31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 21 Feb 2011 19:41:34 +0100 Subject: [PATCH] Fixed #2591 (cppcheck hangs with 100% cpu load ( class A : )) --- lib/tokenize.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index e718fb5e9..cb23f4c39 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9237,9 +9237,11 @@ void Tokenizer::simplifyBorland() // Remove Qt signals and slots void Tokenizer::simplifyQtSignalsSlots() { - Token *tok = _tokens; - while (NULL != (tok = const_cast(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);