Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove an optimisation that's invalid since OCaml 4.14
Since ocaml/ocaml#10681 the Lifthenelse constructor accepts only integers as its condition. (Previously, blocks were accepted as well and considered true) Allowing the optimiser to assume that the argument to Lifthenelse is an integer improves code generation in some cases. However, generation of Lambda must change (e.g. Lifthenelse(Pisint(x),...) instead of Lifthenelse(x, ...)). Malfunction contained an optimisation that generated Lifthenelse of values that may be blocks in some cases, copied from a similar optimisation in OCaml 4.13 and below. That optimisation was removed but the copy in Malfunction was not, and is now invalid. This causes a miscompilation, but only in very specific circumstances (because the assumption that Lifthenelse takes an integer is not widely relied upon). The fix is to delete the now-invalid optimisation, as it wasn't very important and is now wrong. Fixes #36.
- Loading branch information