Fixed #6659 (heap user after free: kernel: sm750_accel.c)

This commit is contained in:
Frank Zingsheim 2015-05-01 18:28:00 +02:00 committed by Daniel Marjamäki
parent 4ceed51bfb
commit 9bea7bec92
2 changed files with 4 additions and 2 deletions

View File

@ -2158,7 +2158,9 @@ static Token *skipTernaryOp(Token *tok)
break;
}
}
if (Token::Match(tok->next(), "[{};]"))
if (tok->link() && Token::Match(tok, "[(<]"))
tok = tok->link();
else if (Token::Match(tok->next(), "[{};)]"))
break;
}
if (colonlevel) // Ticket #5214: Make sure the ':' matches the proper '?'

View File

@ -209,7 +209,7 @@ private:
ASSERT_THROW(checkCode("void f() {switch (n) { case 0?1;:{2} : z(); break;}}"), InternalError);
ASSERT_THROW(checkCode("void f() {switch (n) { case 0?(1?{3:4}):2 : z(); break;}}"), InternalError);
checkCode("void f() {switch (n) { case 0?(1?{3:4}):2 : z(); break;}}");
//ticket #4234
ASSERT_THROW(checkCode("( ) { switch break ; { switch ( x ) { case } y break ; : } }"), InternalError);