From 169628a6abf2bf32a9f73a7db5b4fd3ea973d97a Mon Sep 17 00:00:00 2001 From: Zuhaitz-dev Date: Thu, 16 Apr 2026 17:24:21 +0100 Subject: [PATCH] tccgen: Fix optional semicolon regression --- tccgen.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tccgen.c b/tccgen.c index e1eb6c4e..641e863e 100644 --- a/tccgen.c +++ b/tccgen.c @@ -8718,10 +8718,6 @@ static int decl(int l) return 1; next(); continue; - } else if (l != VT_JMP && l != VT_CMP) { - /* no semicolon - let caller handle it */ - } else { - expect(";"); } while (1) { /* iterate thru each declaration */ @@ -8908,7 +8904,10 @@ static int decl(int l) if (tok != ',') { if (l == VT_JMP) return has_init ? v : 1; - if (tok == ';') next(); + if (l == VT_CMP) + skip(';'); + else if (tok == ';') + next(); break; } next();