Skip to content

Commit

Permalink
Fix #12690 fuzzing timeout in Tokenizer::simplifyTypedef()
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed May 1, 2024
1 parent e4f7087 commit b5604e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8427,6 +8427,7 @@ void Tokenizer::findGarbageCode() const
"goto",
"if",
"return",
"static",
"switch",
"throw",
"typedef",
Expand Down Expand Up @@ -8510,7 +8511,7 @@ void Tokenizer::findGarbageCode() const
if (Token::Match(prev, "%op%|%num%|%str%|%char%")) {
if (!Token::simpleMatch(tok->tokAt(-2), "operator \"\" if") &&
!Token::simpleMatch(tok->tokAt(-2), "extern \"C\"") &&
!Token::simpleMatch(prev, "> typedef"))
!Token::Match(prev, "> typedef|static"))
syntaxError(tok, prev == tok->previous() ? (prev->str() + " " + tok->str()) : (prev->str() + " .. " + tok->str()));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
typedef static i i,n.i

0 comments on commit b5604e9

Please sign in to comment.