perl/perl-5.18.2-overflow.diff

12 lines
676 B
Diff

--- ./sv.c.orig 2022-05-21 21:26:59.000000000 +0000
+++ ./sv.c 2022-06-23 11:53:50.561877702 +0000
@@ -2002,7 +2002,7 @@ S_sv_2iuv_common(pTHX_ SV *const sv)
#ifndef NV_PRESERVES_UV
&& SvIVX(sv) != IV_MIN /* avoid negating IV_MIN below */
&& (((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 */