perl/perl-5.18.2-overflow.diff

12 lines
551 B
Diff

--- sv.c.bak 2014-03-24 15:11:48.007595042 +0100
+++ sv.c 2014-03-25 11:57:41.154752451 +0100
@@ -2008,7 +2008,7 @@ S_sv_2iuv_common(pTHX_ SV *const sv)
if (SvNVX(sv) == (NV) SvIVX(sv)
#ifndef NV_PRESERVES_UV
&& (((UV)1 << NV_PRESERVES_UV_BITS) >
- (UV)(SvIVX(sv) > 0 ? SvIVX(sv) : -SvIVX(sv)))
+ (UV)(SvIVX(sv) > 0 ? (UV)SvIVX(sv) : -(UV)SvIVX(sv)))
/* Don't flag it as "accurately an integer" if the number
came from a (by definition imprecise) NV operation, and
we're outside the range of NV integer precision */