Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, "++|-- ++|--")) {
syntaxError(tok, tok->str() + tok->strAt(1));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean that we still crash for the fuzzer code if --language=c++ is used?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we already throw a syntax error for C++.

}
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());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d(){e?&d=d++++F:a}
Loading