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()); 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