Fixed crash on complex cast.
This commit is contained in:
parent
d42275c5f1
commit
55c87248ba
|
@ -383,7 +383,7 @@ static bool iscast(const Token *tok)
|
|||
|
||||
bool type = false;
|
||||
for (const Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) {
|
||||
if (tok2->link() && tok2->str() == "<")
|
||||
while (tok2->link() && Token::Match(tok2, "(|[|<"))
|
||||
tok2 = tok2->link()->next();
|
||||
|
||||
if (tok2->str() == ")")
|
||||
|
|
|
@ -10600,6 +10600,7 @@ private:
|
|||
ASSERT_EQUALS("ac*(=", testAst("a = (Foo*)*c;"));
|
||||
ASSERT_EQUALS("ac-(=", testAst("a = (long)-c;"));
|
||||
ASSERT_EQUALS("ac(=", testAst("a = (some<strange, type>)c;"));
|
||||
ASSERT_EQUALS("afoveon_avgimage((foveon_avgimage((+=", testAst("a = foveon_avg(((short(*)[4]) image)) + foveon_avg(((short(*)[4]) image));"));
|
||||
|
||||
ASSERT_EQUALS("ab-(=", testAst("a = ((int)-b)")); // Multiple subsequent unary operators (cast and -)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue