AST: Fixed crash

This commit is contained in:
Daniel Marjamäki 2013-11-10 15:51:33 +01:00
parent 85b41059c5
commit bb746261d3
2 changed files with 3 additions and 1 deletions

View File

@ -599,7 +599,8 @@ static void compileComma(Token *&tok, std::stack<Token*> &op)
static void compileExpression(Token *&tok, std::stack<Token*> &op)
{
compileComma(tok,op);
if (tok)
compileComma(tok,op);
}
void TokenList::createAst()

View File

@ -9966,6 +9966,7 @@ private:
ASSERT_EQUALS("a\'\'=", testAst("a=\'\'"));
testAst("char a[1]=\"\";"); // don't crash
testAst("int f(char argv[]);"); // don't crash
testAst("--"); // don't crash
}
void astpar() const { // parentheses