From 974c9a903b0dcd82ea05a76e8e99486495a66ba8 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Fri, 3 Jul 2026 14:34:33 +0200 Subject: [PATCH 1/2] Update tokenlist.cpp --- lib/tokenlist.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 5921621fed2..c28075fcec7 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -1951,8 +1951,11 @@ void TokenList::validateAst(bool print) const if (tok->str() == "?") { if (!tok->astOperand1() || !tok->astOperand2()) throw InternalError(tok, "AST broken, ternary operator missing operand(s)", InternalError::AST); - if (tok->astOperand2()->str() != ":") + const Token* colon = tok->astOperand2(); + if (colon->str() != ":") throw InternalError(tok, "Syntax Error: AST broken, ternary operator lacks ':'.", InternalError::AST); + if ((colon->astOperand1() && !precedes(colon->astOperand1(), colon)) || !succeeds(colon->astOperand2(), colon)) + throw InternalError(tok, "AST broken, ternary operator has bad operand(s)", InternalError::AST); } // Check for endless recursion From b9bf0f722702898ca65601d253ca88bf6ffca1be Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Fri, 3 Jul 2026 14:35:42 +0200 Subject: [PATCH 2/2] Create 14742 --- test/cli/fuzz-crash_c/14742 | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/cli/fuzz-crash_c/14742 diff --git a/test/cli/fuzz-crash_c/14742 b/test/cli/fuzz-crash_c/14742 new file mode 100644 index 00000000000..a645277c405 --- /dev/null +++ b/test/cli/fuzz-crash_c/14742 @@ -0,0 +1 @@ +i(){b?8:{}!$}