Join GitHub today
Integer marshalling is inconsistent between architectures #5793
Original bug ID: 5793
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.