summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-07-15 08:59:13 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-07-15 08:59:13 +0000
commit219bf41872a28e4a469d4274a14dca87429a5a5e (patch)
tree240666aa427d8bd88a5cdebf7e48798d6ca31b3c /util.c
parenta469502ffde47af0b05b575bdfc51039218392df (diff)
downloadperl-219bf41872a28e4a469d4274a14dca87429a5a5e.tar.gz
Upgrade to version 0.76 by John Peacock
Fix segfault in serialized version objects (bug #56606) p4raw-id: //depot/perl@34142
Diffstat (limited to 'util.c')
-rw-r--r--util.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/util.c b/util.c
index b59959c6dc..18d3ed3c19 100644
--- a/util.c
+++ b/util.c
@@ -4814,21 +4814,28 @@ the original version contained 1 or more dots, respectively
SV *
Perl_vstringify(pTHX_ SV *vs)
{
- SV *pv;
-
PERL_ARGS_ASSERT_VSTRINGIFY;
if ( SvROK(vs) )
vs = SvRV(vs);
-
+
if ( !vverify(vs) )
Perl_croak(aTHX_ "Invalid version object");
- pv = *hv_fetchs((HV*)vs, "original", FALSE);
- if ( SvPOK(pv) )
- return newSVsv(pv);
- else
- return &PL_sv_undef;
+ if (hv_exists((HV*)vs, "original", sizeof("original") - 1)) {
+ SV *pv;
+ pv = *hv_fetchs((HV*)vs, "original", FALSE);
+ if ( SvPOK(pv) )
+ return newSVsv(pv);
+ else
+ return &PL_sv_undef;
+ }
+ else {
+ if ( hv_exists((HV *)vs, "qv", 2) )
+ return vnormal(vs);
+ else
+ return vnumify(vs);
+ }
}
/*