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

Compare does not work because we are using int64 #1

Open
imeckler opened this issue Nov 25, 2021 · 2 comments
Open

Compare does not work because we are using int64 #1

imeckler opened this issue Nov 25, 2021 · 2 comments

Comments

@imeckler
Copy link

The way UInt64s are handled does not properly install the written comparison function.

I believe this is because uint64 values are actually represented as int64 so the setting of custom functions here does nothing:

    caml_custom_ops["integers:uint64"] =
    { serialize: caml_int64_marshal
    , deserialize: caml_int64_unmarshal
    , hash: caml_int64_hash
    , compare: integers_uint64_compare };

As a result, the compare function for uint64s is the signed compare, and thus does not work correctly.

@hhugo
Copy link

hhugo commented Dec 8, 2021

I agree with the analysis.

@mrmr1993
Copy link
Member

We have a fix for this in MinaProtocol/mina#10284 (thanks @mitschabaude!). I'll try to update here and push to opam sometime over the weekend.

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

No branches or pull requests

3 participants