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

Integer marshalling is inconsistent between architectures #5793

Closed
vicuna opened this issue Oct 17, 2012 · 1 comment
Closed

Integer marshalling is inconsistent between architectures #5793

vicuna opened this issue Oct 17, 2012 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Oct 17, 2012

Original bug ID: 5793
Reporter: @ppedrot
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2015-12-11T18:18:36Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.00.2+dev
Category: standard library
Related to: #5977

Bug description

When marshalling integers between 32 and 64-bits architectures, integers which are inbetween 2^31 and 2^32 - 1 are treated in a inconsistent way.

In particular, 64-bit architectures marshal them as 32-bit integers, while 32-bit architectures unmarshal them as if they were only 31-bit long, thus resulting in an silent overflow.

Steps to reproduce

On a 64-bit arch, retrieve the string produced by the following command:

Marshal.to_string (1 lsl 30) []

Then on a 32-bit arch, unmarshal the previous string. This results in an overflow.

@vicuna
Copy link
Author

vicuna commented Jan 16, 2013

Comment author: @xclerc

Fixed in both '4.00' (revision 13242) and trunk (revision 13241) branches.

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

1 participant