authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-10-10 01:20:24-07:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-22 12:21:43+02:00
loga2ce4c1bfbf28d1bd2f0b783ee6bef083327e98f
treeea224b2b67e96499c948e2878cbbf906dc8a4cb1
parent723c70fd438a6e9221155ff632a9974e30a7fe14

aro: Always apply usual arithmetic conversion to ternary result

See https://github.com/Vexu/arocc/pull/1117 for context

1 files changed, 1 insertions(+), 1 deletions(-)

lib/compiler/aro/aro/Preprocessor/Parser.zig+1-1
......@@ -323,7 +323,7 @@ fn binaryExpr(p: *Parser, min_prec: Token.Precedence, eval: bool) Error!?Value {
323323 const else_res = try p.binaryExpr(op_prec, eval_else) orelse return null;
324324
325325 lhs = if (lhs.toBool()) rhs else else_res;
326 if ((eval and rhs == .unsigned) or else_res == .unsigned) {
326 if (rhs == .unsigned or else_res == .unsigned) {
327327 try lhs.toUnsigned(p, operator, "right");
328328 }
329329 },