-
Notifications
You must be signed in to change notification settings - Fork 189
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
Big integers are truncated #285
Comments
As a side note, printing hex representations of integers in the warnings is a bit misleading in this case because they are exactly the same (but integers themselves and their signed decimal representations differ) |
Integers are not 64 bits in javascript, so yes, you will have to change bin_prot I think. Note that the way it's currently done in bin_prot could be considered a bug, given how hostile to cross-compilation (and js_of_ocaml) it is. |
/cc @diml |
There are some work in progress to solve this inside core & co (including bin_prot). |
error message improved by f39398b |
I am having trouble using bin_prot library with js_of_ocaml. The following code:
when run in the browser produces
Size: 9
instead of correctSize: 5
. Here is the relevant block of bin_prot source code: https://github.com/janestreet/bin_prot/blob/master/lib/size.ml#L16-L22js_of_ocaml compiler produces a bunch of warnings:
and in this case the generated code is indeed incorrect. The most obvious solution is to get rid of big integers in the source code but it is in third-party library and thus not easily modifiable. Am I out of luck?
The text was updated successfully, but these errors were encountered: