summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2001-01-07 21:07:18 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-01-08 02:42:59 +0000
commit09bb3e277be365399d3c135a30bd01910fe25c56 (patch)
tree6a8aec90378def8ec05b65cdfccc04cbb3761bd7 /sv.c
parent5acaa6ec689aa2e39b6ec028d286e5561be1d297 (diff)
downloadperl-09bb3e277be365399d3c135a30bd01910fe25c56.tar.gz
[ID 20010107.012] [PATCH] 18446744073709551616e0 was treated as UV=18446744073709551615
Message-Id: <20010107210717.D1048@plum.flirble.org> p4raw-id: //depot/perl@8366
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index c4935d8311..0da17e1fa0 100644
--- a/sv.c
+++ b/sv.c
@@ -1678,6 +1678,12 @@ S_sv_2iuv_non_preserve (pTHX_ register SV *sv, I32 numtype)
SvIsUV_on(sv);
SvUVX(sv) = U_V(SvNVX(sv));
if ((NV)(SvUVX(sv)) == SvNVX(sv)) {
+ if (SvUVX(sv) == UV_MAX) {
+ /* As we know that NVs don't preserve UVs, UV_MAX cannot
+ possibly be preserved by NV. Hence, it must be overflow.
+ NOK, IOKp */
+ return IS_NUMBER_OVERFLOW_UV;
+ }
SvIOK_on(sv); /* Integer is precise. NOK, UOK */
} else {
/* Integer is imprecise. NOK, IOKp */