You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On 64bit target implementations (eg x86_64) and with LNUM on int32
mode (default), assignation of an integer number greater than
UINT_MAX (ie 4294967295), but lesser or equal than UINT_MAX +
0x7FFFFFFF + 1 (ie 6442450943) to a variable does result in
truncation of the final value stored in memory.
Cause:
LNUM does perform a C-Style cast in the intermediate function wrapper
used to check for the fitness of numbers. This cast is not only unnecessary
but also brings on undefined behaviour on 64bit target implementations
where INT's and LONG's are of size 32 and 64bit respectively.
Fix:
Removal of the unnecessary cast in wrapper does bring back the 'overflow detection'.
Regards, Víctor Calvís.
The text was updated successfully, but these errors were encountered:
vcalvis:
On 64bit target implementations (eg x86_64) and with LNUM on int32
mode (default), assignation of an integer number greater than
UINT_MAX (ie 4294967295), but lesser or equal than UINT_MAX +
0x7FFFFFFF + 1 (ie 6442450943) to a variable does result in
truncation of the final value stored in memory.
E.g.:
> n=4294967296; print(n)
0
> n=6442450943; print(n)
2147483647
Cause:
LNUM does perform a C-Style cast in the intermediate function wrapper
used to check for the fitness of numbers. This cast is not only unnecessary
but also brings on undefined behaviour on 64bit target implementations
where INT's and LONG's are of size 32 and 64bit respectively.
Fix:
Removal of the unnecessary cast in wrapper does bring back the 'overflow detection'.
Regards, Víctor Calvís.
The text was updated successfully, but these errors were encountered: