Skip to content

Division_by_zero optimized away #1760

@jmid

Description

@jmid

The program

print_int (let c = (/) 0 0 in 0)

succeeds under BuckleScript 1.8.0 (Using OCaml4.02.3+BS )
but throws a Division_by_zero exception (as expected) using the OCaml bytecode backend.
On a related note:

print_int (let h = ((mod) 0 0) in 0)

exhibits the same difference in behaviour.

Note: there have been similar recent issues with optimizations of division in the OCaml native code backend: https://caml.inria.fr/mantis/view.php?id=7201
As a casual user I don't know how much BuckleScript shares with OCaml's middle/backend, and hence whether these could be inherited bugs.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions