fixed a hang in Tokenizer::simplifyFunctionParameters
This commit is contained in:
parent
774e331dea
commit
e0ecef5d71
|
@ -3042,15 +3042,7 @@ void Tokenizer::simplifyFunctionParameters()
|
|||
{
|
||||
for (Token *tok = _tokens; tok; tok = tok->next())
|
||||
{
|
||||
if (tok->str() == "{")
|
||||
{
|
||||
tok = tok->link();
|
||||
if (!tok)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tok->str() == "(")
|
||||
if (tok->str() == "{" || tok->str() == "[" || tok->str() == "(")
|
||||
{
|
||||
tok = tok->link();
|
||||
if (!tok)
|
||||
|
|
|
@ -1934,6 +1934,11 @@ private:
|
|||
|
||||
void simplify_function_parameters()
|
||||
{
|
||||
{
|
||||
const char code[] = "char a [ ABC ( DEF ) ] ;";
|
||||
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 , char y ) { }", tokenizeAndStringify("void f(x,y) int x; char y; { }", true));
|
||||
|
||||
|
|
Loading…
Reference in New Issue