Skip to content

Commit

Permalink
Fix #13495 #13499 Fuzzing crashes (#7159)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Jan 2, 2025
1 parent 7a40fbc commit 3216458
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8736,6 +8736,8 @@ void Tokenizer::findGarbageCode() const
syntaxError(tok);
if (Token::Match(tok, "; %assign%"))
syntaxError(tok);
if (Token::Match(tok, "%assign% %name%") && tok->next()->isControlFlowKeyword())
syntaxError(tok);
if (Token::Match(tok, "%cop%|=|,|[ %or%|%oror%|/|%"))
syntaxError(tok);
if (Token::Match(tok, "[;([{] %comp%|%oror%|%or%|%|/"))
Expand Down Expand Up @@ -8841,6 +8843,8 @@ void Tokenizer::findGarbageCode() const
syntaxError(tok);
}
}
if (cpp && tok->str() == "using" && !Token::Match(tok->next(), "::|%name%"))
syntaxError(tok);
}

// ternary operator without :
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(){using}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d(){A a;n=do{}while(N)t}

0 comments on commit 3216458

Please sign in to comment.