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

Packed tuples get corrupted when one of their fields is an int of 10 digits or more #13

Closed
dawkot opened this issue Nov 22, 2017 · 0 comments

Comments

@dawkot
Copy link

dawkot commented Nov 22, 2017

import msgpack4nim

proc unpack[T](s: string, typ: typedesc[T]): T =
    s.unpack result

echo((-557853050, 0).pack.unpack((int, int)))
echo((-5578530500, 0).pack.unpack((int, int)))

echo((0, -557853050, 0).pack.unpack((int, int, int)))
echo((0, -5578530500, 0).pack.unpack((int, int, int)))

echo((0, -5578530500, 0, 0).pack.unpack((int, int, int, int)))

(Field0: -557853050, Field1: 0)
(Field0: -5578530500, Field1: -1283563204)
(Field0: 0, Field1: -557853050, Field2: 0)
(Field0: 0, Field1: -5578530500, Field2: -1283563204)
(Field0: 0, Field1: -5578530500, Field2: -1283563204, Field3: 0)

@jangko jangko closed this as completed in c20e165 Nov 23, 2017
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

1 participant