ast: fixed hang when checking bin-prot

This commit is contained in:
Daniel Marjamäki 2014-02-04 19:33:26 +01:00
parent 486a3192c0
commit 2ed3b40937
2 changed files with 6 additions and 0 deletions

View File

@ -447,6 +447,9 @@ static void compileTerm(Token *& tok, std::stack<Token*> &op)
} else if (!Token::Match(tok->next(), "(|[") && !templatefunc) {
op.push(tok);
tok = tok->next();
} else if (Token::Match(tok, "%type% ( {")) {
op.push(tok);
tok = tok->linkAt(2);
} else {
Token *name = tok;
Token *par = templatefunc ? tok->linkAt(1)->next() : tok->next();

View File

@ -10157,6 +10157,9 @@ private:
// ({..})
ASSERT_EQUALS("a{+d+ bc+", testAst("a+({b+c;})+d"));
ASSERT_EQUALS("a{d*+ bc+", testAst("a+({b+c;})*d"));
ASSERT_EQUALS("xa(= bc( yd(= ef(", testAst("x=(int)(a({b(c);}));"
"y=(int)(d({e(f);}));"));
}
void astbrackets() const { // []