summaryrefslogtreecommitdiff
path: root/vutil.c
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@cpan.org>2013-12-25 14:19:19 -0500
committerFather Chrysostomos <sprout@cpan.org>2014-01-04 05:10:04 -0800
commit95a23f5d4555e7aada6ee78c54dec1abd1521aec (patch)
treed51f669cddba48f992a0e9dd03412300bc9e740a /vutil.c
parent4141ef59170e80715499432a2f4b9bfca704247d (diff)
downloadperl-95a23f5d4555e7aada6ee78c54dec1abd1521aec.tar.gz
Grab latest changes from CPAN 0.9905
Diffstat (limited to 'vutil.c')
-rw-r--r--vutil.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vutil.c b/vutil.c
index 303e76c45c..8eafd75d37 100644
--- a/vutil.c
+++ b/vutil.c
@@ -521,7 +521,7 @@ Perl_new_version(pTHX_ SV *ver)
}
else {
#endif
- sv_setsv(rv,ver); /* make a duplicate */
+ SvSetSV_nosteal(rv, ver); /* make a duplicate */
#ifdef SvVOK
}
}
@@ -598,6 +598,7 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
#endif
else if ( (SvUOK(ver) && SvUVX(ver) > VERSION_MAX)
|| (SvIOK(ver) && SvIVX(ver) > VERSION_MAX) ) {
+ /* out of bounds [unsigned] integer */
STRLEN len;
char tbuf[64];
len = my_snprintf(tbuf, sizeof(tbuf), "%d", VERSION_MAX);
@@ -605,6 +606,9 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
Perl_ck_warner(aTHX_ packWARN(WARN_OVERFLOW),
"Integer overflow in version %d",VERSION_MAX);
}
+ else if ( SvUOK(ver) || SvIOK(ver) ) {
+ version = savesvpv(ver);
+ }
else /* must be a string or something like a string */
{
STRLEN len;