Fixed #9034 (crash on reading invalid code: '> typedef')
This commit is contained in:
parent
68dd203f43
commit
15676612c0
|
@ -9046,6 +9046,8 @@ void Tokenizer::findGarbageCode() const
|
|||
for (const Token *tok = tokens(); tok; tok = tok->next()) {
|
||||
if (Token::Match(tok, "%name% %name%") && nonConsecutiveKeywords.count(tok->str()) == 1 && nonConsecutiveKeywords.count(tok->next()->str()) == 1)
|
||||
syntaxError(tok);
|
||||
if (Token::Match(tok, "%op% %name%") && nonConsecutiveKeywords.count(tok->next()->str()) == 1)
|
||||
syntaxError(tok);
|
||||
}
|
||||
|
||||
// case keyword must be inside switch
|
||||
|
|
|
@ -1655,6 +1655,7 @@ private:
|
|||
void syntaxErrorFuzzerCliType1() {
|
||||
ASSERT_THROW(checkCode("void f(){x=0,return return''[]()}"), InternalError);
|
||||
ASSERT_THROW(checkCode("void f(){x='0'++'0'(return)[];}"), InternalError); // #9063
|
||||
ASSERT_THROW(checkCode("void f() { x= 'x' > typedef name5 | ( , ;){ } (); }"), InternalError); // #9067
|
||||
}
|
||||
|
||||
void enumTrailingComma() {
|
||||
|
|
Loading…
Reference in New Issue