Identity folding (x == x, x <= x, x >= x -> true) is currently applied without verifying expression types. Under IEEE 754, comparisons involving NaN evaluate to false.
Add type checks in simplify_bool.go to prevent identity folding on floating-point operands.
Files: internal/optimizer/simplify_bool.go (lines 67, 90)
Identity folding (
x == x,x <= x,x >= x->true) is currently applied without verifying expression types. Under IEEE 754, comparisons involvingNaNevaluate tofalse.Add type checks in
simplify_bool.goto prevent identity folding on floating-point operands.Files:
internal/optimizer/simplify_bool.go(lines 67, 90)