From 2edc807cfc8ce80e74e932a8d84a809a44ec0c3d Mon Sep 17 00:00:00 2001 From: Simmo Saan Date: Wed, 28 Jan 2026 15:35:04 +0200 Subject: [PATCH] Fold constant conditional expressions, even without lowerConstants --- src/frontc/cabs2cil.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontc/cabs2cil.ml b/src/frontc/cabs2cil.ml index 023a3eb5b..2f847eb04 100644 --- a/src/frontc/cabs2cil.ml +++ b/src/frontc/cabs2cil.ml @@ -5239,7 +5239,7 @@ and doCondExp (asconst: bool) (* Try to evaluate the conditional expression | _ -> let (se, e, t) = doExp asconst e (AExp None) in ignore (checkBool t e); - CEExp (se, if !lowerConstants then constFold asconst e else e) + CEExp (se, if !lowerConstants || asconst then constFold asconst e else e) and compileCondExp (asconst:bool) (ce: condExpRes) (st: chunk) (sf: chunk) : chunk = match ce with