From a2ce4c1bfbf28d1bd2f0b783ee6bef083327e98f Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Sat, 10 Oct 2026 01:20:24 -0700 Subject: [PATCH] aro: Always apply usual arithmetic conversion to ternary result See https://github.com/Vexu/arocc/pull/1117 for context --- lib/compiler/aro/aro/Preprocessor/Parser.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compiler/aro/aro/Preprocessor/Parser.zig b/lib/compiler/aro/aro/Preprocessor/Parser.zig index c9a964b44ce5ac3e48cf3ca711218d478d8ff46c..d005e02385b312daa7bb616ef6c77788fd94b351 100644 --- a/lib/compiler/aro/aro/Preprocessor/Parser.zig +++ b/lib/compiler/aro/aro/Preprocessor/Parser.zig @@ -323,7 +323,7 @@ fn binaryExpr(p: *Parser, min_prec: Token.Precedence, eval: bool) Error!?Value { const else_res = try p.binaryExpr(op_prec, eval_else) orelse return null; lhs = if (lhs.toBool()) rhs else else_res; - if ((eval and rhs == .unsigned) or else_res == .unsigned) { + if (rhs == .unsigned or else_res == .unsigned) { try lhs.toUnsigned(p, operator, "right"); } }, -- 2.54.0