Subject: | native_to_uint64 doesn't work as expected if native integers are used |
As a result of function native_to_uint64 IV is always returned. The problem is in incorrect use of function newSVuv:
if (use_native) {
RETVAL = newSVuv(0);
Copy(pv, &(SvUVX(RETVAL)), 8, char);
}
newSVuv internally uses function sv_setuv which starts with following lines:
if (u <= (UV)IV_MAX) {
sv_setiv(sv, (IV)u);
return;
}
As you could see, zero is not a good choice.