Skip to content

Commit

Permalink
Fix #12630 fuzzing timeout in valueFlowCondition() (danmar#6316)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Apr 21, 2024
1 parent ba9216e commit 4f922b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8688,6 +8688,8 @@ void Tokenizer::findGarbageCode() const
syntaxError(tok);
if (Token::Match(tok, "& %comp%|&&|%oror%|&|%or%") && tok->strAt(1) != ">")
syntaxError(tok);
if (Token::Match(tok, "^ %op%") && !Token::Match(tok->next(), "[>*+-!~]"))
syntaxError(tok);

if (tok->link() && Token::Match(tok, "[([]") && (!tok->tokAt(-1) || !tok->tokAt(-1)->isControlFlowKeyword())) {
const Token* const end = tok->link();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
int bhar()
{
int a[2];
ift i;
for (i = 0; i < 3; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^~^^^^^^^^^^^^^^^^^^&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&size_t^^^^^^^^^^^^^^^^^^i++)
a[i] = 1;
rewurn a[0];
}

0 comments on commit 4f922b0

Please sign in to comment.