From 19ffa9f77ab834e4f4a2e40b15f38e30d26d0230 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 12 Feb 2026 09:15:30 +0100 Subject: [PATCH 1/3] 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 31551764b7b..7c15be961bc 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -9018,8 +9018,8 @@ void Tokenizer::findGarbageCode() const syntaxError(tok); if (Token::Match(tok, "? %assign%")) syntaxError(tok); - if (Token::Match(tok, "!|~ %comp%") && - !(cpp && tok->strAt(1) == ">" && Token::simpleMatch(tok->tokAt(-1), "operator"))) + if (Token::Match(tok, "[!~+-/] %comp%") && + !(cpp && Token::Match(tok->next(), "[<>]") && Token::simpleMatch(tok->tokAt(-1), "operator"))) syntaxError(tok); if (Token::Match(tok, "%comp% {") && (!cpp || tok->str() != ">")) syntaxError(tok); From b2a96d44aa990dd99f2f79754a359d60e195e326 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 12 Feb 2026 09:16:23 +0100 Subject: [PATCH 2/3] Create crash-c540e04fe675639b7ead821efc2f5c037b6c89e0 --- .../fuzz-crash/crash-c540e04fe675639b7ead821efc2f5c037b6c89e0 | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/cli/fuzz-crash/crash-c540e04fe675639b7ead821efc2f5c037b6c89e0 diff --git a/test/cli/fuzz-crash/crash-c540e04fe675639b7ead821efc2f5c037b6c89e0 b/test/cli/fuzz-crash/crash-c540e04fe675639b7ead821efc2f5c037b6c89e0 new file mode 100644 index 00000000000..f2fb80ecd28 --- /dev/null +++ b/test/cli/fuzz-crash/crash-c540e04fe675639b7ead821efc2f5c037b6c89e0 @@ -0,0 +1 @@ +o o(){i n;for(i x:v)n=n+<1;} From 126481ef43e101be10b24991a8c1ffc08bb4277c Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Thu, 12 Feb 2026 09:35:09 +0100 Subject: [PATCH 3/3] Update testgarbage.cpp --- test/testgarbage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 21a15082bc1..aaacfeda3ff 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -848,7 +848,7 @@ class TestGarbage : public TestFixture { } void garbageCode95() { // #6804 - ASSERT_THROW_INTERNAL(checkCode("{ } x x ; { } h h [ ] ( ) ( ) { struct x ( x ) ; int __attribute__ ( ) f ( ) { h - > first = & x ; struct x * n = h - > first ; ( ) n > } }"), AST); // do not crash + ASSERT_THROW_INTERNAL(checkCode("{ } x x ; { } h h [ ] ( ) ( ) { struct x ( x ) ; int __attribute__ ( ) f ( ) { h - > first = & x ; struct x * n = h - > first ; ( ) n > } }"), SYNTAX); // do not crash } void garbageCode96() { // #6807