Skip to content

Commit 3216458

Browse files
Fix #13495 #13499 Fuzzing crashes (danmar#7159)
1 parent 7a40fbc commit 3216458

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

lib/tokenize.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8736,6 +8736,8 @@ void Tokenizer::findGarbageCode() const
87368736
syntaxError(tok);
87378737
if (Token::Match(tok, "; %assign%"))
87388738
syntaxError(tok);
8739+
if (Token::Match(tok, "%assign% %name%") && tok->next()->isControlFlowKeyword())
8740+
syntaxError(tok);
87398741
if (Token::Match(tok, "%cop%|=|,|[ %or%|%oror%|/|%"))
87408742
syntaxError(tok);
87418743
if (Token::Match(tok, "[;([{] %comp%|%oror%|%or%|%|/"))
@@ -8841,6 +8843,8 @@ void Tokenizer::findGarbageCode() const
88418843
syntaxError(tok);
88428844
}
88438845
}
8846+
if (cpp && tok->str() == "using" && !Token::Match(tok->next(), "::|%name%"))
8847+
syntaxError(tok);
88448848
}
88458849

88468850
// ternary operator without :
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$(){using}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d(){A a;n=do{}while(N)t}

0 commit comments

Comments
 (0)