Tokenizer: Fix wrong simplification when checking linux kernel
This commit is contained in:
parent
014f8e3c71
commit
eb1c048d2a
|
@ -4957,7 +4957,7 @@ void Tokenizer::simplifyUndefinedSizeArray()
|
|||
Token *tok2 = tok->next();
|
||||
while (tok2 && tok2->str() == "*")
|
||||
tok2 = tok2->next();
|
||||
if (!Token::Match(tok2, "%var% [ ]"))
|
||||
if (!Token::Match(tok2, "%var% [ ] ;|["))
|
||||
continue;
|
||||
|
||||
tok = tok2->previous();
|
||||
|
|
|
@ -4137,6 +4137,7 @@ private:
|
|||
ASSERT_EQUALS("int * * * x ;", tok("int * x [][];"));
|
||||
ASSERT_EQUALS("int * * * * x ;", tok("int * * x [][];"));
|
||||
ASSERT_EQUALS("void f ( int x [ ] , double y [ ] ) { }", tok("void f(int x[], double y[]) { }"));
|
||||
ASSERT_EQUALS("int x [ 13 ] = { [ 11 ] = 2 , [ 12 ] = 3 } ;", tok("int x[] = {[11]=2, [12]=3};"));
|
||||
}
|
||||
|
||||
void simplifyArrayAddress() { // ticket #3304
|
||||
|
|
Loading…
Reference in New Issue