From 5eb6f851aeb42a93b5016070cc244a8c1d04972f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Wed, 15 Jul 2026 15:32:46 +0200 Subject: [PATCH 1/2] add crash file --- .../fuzz-crash_c/crash-9feb09f580c0cf101456c6c650ab4193b1009d07 | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/cli/fuzz-crash_c/crash-9feb09f580c0cf101456c6c650ab4193b1009d07 diff --git a/test/cli/fuzz-crash_c/crash-9feb09f580c0cf101456c6c650ab4193b1009d07 b/test/cli/fuzz-crash_c/crash-9feb09f580c0cf101456c6c650ab4193b1009d07 new file mode 100644 index 00000000000..8577d6ccb7f --- /dev/null +++ b/test/cli/fuzz-crash_c/crash-9feb09f580c0cf101456c6c650ab4193b1009d07 @@ -0,0 +1 @@ +d(){e?&d=d++++F:a} \ No newline at end of file From b78df5da1d98cc703875586be009e01247507f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludvig=20Gunne=20Lindstr=C3=B6m?= Date: Wed, 15 Jul 2026 15:28:13 +0200 Subject: [PATCH 2/2] fix --- lib/tokenize.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 3dc83082e4e..e7cdd105fde 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -8810,6 +8810,9 @@ void Tokenizer::findGarbageCode() const if (!cpp || mSettings.standards.cpp < Standards::CPP20 || !Token::Match(tok->previous(), "%name% : %num% =")) syntaxError(tok, tok->strAt(1) + " " + tok->strAt(2)); } + else if (!cpp && Token::Match(tok, "++|--") && Token::Match(tok->next(), "++|--")) { + syntaxError(tok, tok->str() + tok->strAt(1)); + } else if (Token::simpleMatch(tok, ") return") && !Token::Match(tok->link()->previous(), "if|while|for (")) { if (tok->link()->previous() && tok->link()->previous()->isUpperCaseName()) unknownMacroError(tok->link()->previous());