These were occurring on FreeBSD smokes.
warning: implicit conversion from 'IV' (aka 'long') to 'double' changes value from
9223372036854775807 to
9223372036854775808 [-Wimplicit-int-float-conversion]
9223372036854775807 is IV_MAX. What needed to be done here was to use
the NV containing IV_MAX+1, a value that already exists in perl.h
In other instances, simply casting to an NV before doing the comparison
with the NV was what was needed.
This fixes #18328
#ifdef NV_PAYLOAD_DEBUG
Perl_warn(aTHX_ "a[%d] = %" UVxf "\n", i, a[i]);
#endif
- payload *= UV_MAX;
+ payload *= (NV) UV_MAX;
payload += a[i];
}
#ifdef NV_PAYLOAD_DEBUG
our ($AUTOLOAD, %SIGRT);
-our $VERSION = '1.95';
+our $VERSION = '1.96';
require XSLoader;
/* Written this way so that with an always-false NaN comparison we
* return false */
- if (!(LIKELY(nv >= IV_MIN) && LIKELY(nv <= IV_MAX))) {
+ if (!(LIKELY(nv >= (NV) IV_MIN) && LIKELY(nv < IV_MAX_P1))) {
return FALSE;
}
if ((SvOK(left) && !SvIOK(left) && SvNV_nomg(left) < IV_MIN) ||
(SvOK(right) && (SvIOK(right)
? SvIsUV(right) && SvUV(right) > IV_MAX
- : SvNV_nomg(right) > IV_MAX)))
+ : SvNV_nomg(right) > (NV) IV_MAX)))
DIE(aTHX_ "Range iterator outside integer range");
i = SvIV_nomg(left);
j = SvIV_nomg(right);
(void)SvNOK_on(sv);
/* Can't use strtol etc to convert this string. (See truth table in
sv_2iv */
- if (SvNVX(sv) <= (UV)IV_MAX) {
+ if (SvNVX(sv) < IV_MAX_P1) {
SvIV_set(sv, I_V(SvNVX(sv)));
if ((NV)(SvIVX(sv)) == SvNVX(sv)) {
SvIOK_on(sv); /* Integer is precise. NOK, IOK */
assert(!Perl_isinfnan(nv));
if (neg)
nv = -nv;
- if (nv != 0.0 && nv < UV_MAX) {
+ if (nv != 0.0 && nv < (NV) UV_MAX) {
char *p = endbuf;
uv = (UV)nv;
if (uv != nv) {