Fixed #1196 (Hang: Cppcheck hang for the file linux-2.6/drivers/crypto/hifn_795x.c)

This commit is contained in:
Daniel Marjamäki 2010-01-01 13:26:54 +01:00
parent 7ecd333ffa
commit 77c5b793c9
2 changed files with 7 additions and 1 deletions

View File

@ -3118,7 +3118,8 @@ void Tokenizer::simplifyFunctionParameters()
} }
} }
tok = tok ? tok->link() : 0; if (Token::simpleMatch(tok, "{"))
tok = tok->link();
if (tok == NULL) if (tok == NULL)
{ {

View File

@ -1939,6 +1939,11 @@ private:
ASSERT_EQUALS(code, tokenizeAndStringify(code, true)); ASSERT_EQUALS(code, tokenizeAndStringify(code, true));
} }
{
const char code[] = "module ( a , a , sizeof ( a ) , 0444 ) ;";
ASSERT_EQUALS(code, tokenizeAndStringify(code, true));
}
ASSERT_EQUALS("void f ( int x ) { }", tokenizeAndStringify("void f(x) int x; { }", true)); ASSERT_EQUALS("void f ( int x ) { }", tokenizeAndStringify("void f(x) int x; { }", true));
ASSERT_EQUALS("void f ( int x , char y ) { }", tokenizeAndStringify("void f(x,y) int x; char y; { }", true)); ASSERT_EQUALS("void f ( int x , char y ) { }", tokenizeAndStringify("void f(x,y) int x; char y; { }", true));