|View Issue Details [ Jump to Notes ] ||[ Issue History ] [ Print ] |
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005793||OCaml||OCaml standard library||public||2012-10-17 17:56||2015-12-11 19:18|
|Assigned To||xclerc|| |
|Product Version|| |
|Target Version||Fixed in Version||4.00.2+dev|| |
|Summary||0005793: Integer marshalling is inconsistent between architectures|
|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.
|Tags||No tags attached.|