Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Division_by_zero optimized away #1760

Closed
jmid opened this issue Jul 3, 2017 · 1 comment
Closed

Division_by_zero optimized away #1760

jmid opened this issue Jul 3, 2017 · 1 comment

Comments

@jmid
Copy link

jmid commented Jul 3, 2017

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.

@OvermindDL1
Copy link
Contributor

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.

Bucklescript compiler 'is' (a slightly older version of) the OCaml compiler, just with some addons. :-)
So yes, I'd think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants