Skip to content

Commit 1e8044f

Browse files
committed
Fold constant conditional expressions, even without lowerConstants
1 parent abe64c5 commit 1e8044f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/frontc/cabs2cil.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5239,7 +5239,7 @@ and doCondExp (asconst: bool) (* Try to evaluate the conditional expression
52395239
| _ ->
52405240
let (se, e, t) = doExp asconst e (AExp None) in
52415241
ignore (checkBool t e);
5242-
CEExp (se, if !lowerConstants then constFold asconst e else e)
5242+
CEExp (se, if !lowerConstants || asconst then constFold asconst e else e)
52435243

52445244
and compileCondExp (asconst:bool) (ce: condExpRes) (st: chunk) (sf: chunk) : chunk =
52455245
match ce with

0 commit comments

Comments
 (0)