From 44e019d41aaf57c112ba6a253f1257ec09a16e8d Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 8 Jul 2026 15:30:27 +0200 Subject: [PATCH 1/6] Update tokenize.cpp --- lib/tokenize.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 3046bea69cc..d826b38f18d 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9145,14 +9145,18 @@ void Tokenizer::findGarbageCode() const } if (!tok2->next() || tok2->isControlFlowKeyword() || Token::Match(tok2, "typedef|static|.")) syntaxError(tok); - if (Token::Match(tok2, "%name% %name%") && tok2->str() == tok2->strAt(1)) { - if (Token::simpleMatch(tok2->tokAt(2), ";")) - continue; - if (tok2->isStandardType() && tok2->str() == "long") - continue; - if (Token::Match(tok2->tokAt(-1), "enum|struct|union") || (isCPP() && Token::Match(tok2->tokAt(-1), "class|::"))) - continue; - syntaxError(tok2); + if (Token::Match(tok2, "%name% %name%")) { + if (Token::Match(tok2->tokAt(2), "%name%") && !(tok2->isKeyword() || tok2->tokAt(1)->isKeyword() || tok2->tokAt(2)->isKeyword()) + syntaxError(tok2); + if (tok2->str() == tok2->strAt(1)) { + if (Token::simpleMatch(tok2->tokAt(2), ";")) + continue; + if (tok2->isStandardType() && tok2->str() == "long") + continue; + if (Token::Match(tok2->tokAt(-1), "enum|struct|union") || (isCPP() && Token::Match(tok2->tokAt(-1), "class|::"))) + continue; + syntaxError(tok2); + } } } } From dbe5f99c57b283d12b3c626820e02f610d5e60a8 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 8 Jul 2026 15:31:32 +0200 Subject: [PATCH 2/6] Create timeout-5e798df7f1bc86caef9901d6662319a4d636f269 --- .../timeout-5e798df7f1bc86caef9901d6662319a4d636f269 | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/cli/fuzz-timeout/timeout-5e798df7f1bc86caef9901d6662319a4d636f269 diff --git a/test/cli/fuzz-timeout/timeout-5e798df7f1bc86caef9901d6662319a4d636f269 b/test/cli/fuzz-timeout/timeout-5e798df7f1bc86caef9901d6662319a4d636f269 new file mode 100644 index 00000000000..35e56badcc8 --- /dev/null +++ b/test/cli/fuzz-timeout/timeout-5e798df7f1bc86caef9901d6662319a4d636f269 @@ -0,0 +1 @@ +typedef consted e,{} From f815ce38ad5ab1c29b2bb3359040e15f86d97650 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 8 Jul 2026 15:37:48 +0200 Subject: [PATCH 3/6] Update tokenize.cpp --- lib/tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index d826b38f18d..62a1648d20f 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9146,7 +9146,7 @@ void Tokenizer::findGarbageCode() const if (!tok2->next() || tok2->isControlFlowKeyword() || Token::Match(tok2, "typedef|static|.")) syntaxError(tok); if (Token::Match(tok2, "%name% %name%")) { - if (Token::Match(tok2->tokAt(2), "%name%") && !(tok2->isKeyword() || tok2->tokAt(1)->isKeyword() || tok2->tokAt(2)->isKeyword()) + if (Token::Match(tok2->tokAt(2), "%name%") && !(tok2->isKeyword() || tok2->tokAt(1)->isKeyword() || tok2->tokAt(2)->isKeyword())) syntaxError(tok2); if (tok2->str() == tok2->strAt(1)) { if (Token::simpleMatch(tok2->tokAt(2), ";")) From bf72aa3cc1014d6c7913e77446ca351461da70cf Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Wed, 8 Jul 2026 16:29:01 +0200 Subject: [PATCH 4/6] Update tokenize.cpp --- lib/tokenize.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 62a1648d20f..254691aa337 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9146,8 +9146,6 @@ void Tokenizer::findGarbageCode() const if (!tok2->next() || tok2->isControlFlowKeyword() || Token::Match(tok2, "typedef|static|.")) syntaxError(tok); if (Token::Match(tok2, "%name% %name%")) { - if (Token::Match(tok2->tokAt(2), "%name%") && !(tok2->isKeyword() || tok2->tokAt(1)->isKeyword() || tok2->tokAt(2)->isKeyword())) - syntaxError(tok2); if (tok2->str() == tok2->strAt(1)) { if (Token::simpleMatch(tok2->tokAt(2), ";")) continue; @@ -9157,6 +9155,8 @@ void Tokenizer::findGarbageCode() const continue; syntaxError(tok2); } + if (Token::Match(tok2->tokAt(2), "%name%") && !(tok2->isKeyword() || tok2->tokAt(1)->isKeyword() || tok2->tokAt(2)->isKeyword())) + syntaxError(tok2); } } } From 73b719c090f7c4e1d34ef216f5a839a6008cc5bc Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Wed, 8 Jul 2026 20:01:14 +0200 Subject: [PATCH 5/6] Fix --- lib/tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 254691aa337..fe42ebd0c4a 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9155,7 +9155,7 @@ void Tokenizer::findGarbageCode() const continue; syntaxError(tok2); } - if (Token::Match(tok2->tokAt(2), "%name%") && !(tok2->isKeyword() || tok2->tokAt(1)->isKeyword() || tok2->tokAt(2)->isKeyword())) + if (Token::Match(tok2->tokAt(2), "%name%") && tok2->isNameOnly() && tok2->tokAt(1)->isNameOnly() && tok2->tokAt(2)->isNameOnly()) syntaxError(tok2); } } From d3ec74a516afafbdf47427e428c94aebd6dca20d Mon Sep 17 00:00:00 2001 From: chrchr-github Date: Wed, 8 Jul 2026 20:15:14 +0200 Subject: [PATCH 6/6] Format --- lib/tokenize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index fe42ebd0c4a..d2ad6f581e7 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9156,7 +9156,7 @@ void Tokenizer::findGarbageCode() const syntaxError(tok2); } if (Token::Match(tok2->tokAt(2), "%name%") && tok2->isNameOnly() && tok2->tokAt(1)->isNameOnly() && tok2->tokAt(2)->isNameOnly()) - syntaxError(tok2); + syntaxError(tok2); } } }