Fix crash in createAST when checking wiggle in daca@home
This commit is contained in:
parent
5578b09452
commit
0ec77879ea
|
@ -1422,7 +1422,7 @@ static Token * createAstAtToken(Token *tok, bool cpp)
|
|||
init1 = tok2;
|
||||
AST_state state1(cpp);
|
||||
compileExpression(tok2, state1);
|
||||
if (init1->str() == "(") {
|
||||
if (Token::Match(init1, "( !!{")) {
|
||||
for (Token *tok3 = init1; tok3 != tok3->link(); tok3 = tok3->next()) {
|
||||
if (tok3->astParent()) {
|
||||
while (tok3->astParent())
|
||||
|
|
|
@ -7601,6 +7601,7 @@ private:
|
|||
ASSERT_EQUALS("forab,c:(", testAst("for (auto [a,b]: c);"));
|
||||
ASSERT_EQUALS("fora*++;;(", testAst("for (++(*a);;);"));
|
||||
ASSERT_EQUALS("foryz:(", testAst("for (decltype(x) *y : z);"));
|
||||
ASSERT_EQUALS("for(tmpNULL!=tmptmpnext.=;;( tmpa=", testAst("for ( ({ tmp = a; }) ; tmp != NULL; tmp = tmp->next ) {}"));
|
||||
|
||||
// problems with multiple expressions
|
||||
ASSERT_EQUALS("ax( whilex(", testAst("a(x) while (x)"));
|
||||
|
|
Loading…
Reference in New Issue