summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-04-27 22:21:35 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-04-27 22:21:35 +0000
commit8f3c2c0cb1ce993e7d37b84cf6256c76fd3a298a (patch)
treef5e0304d5a88e4c476b6675534f368e3388f63b5 /pp.c
parentef1087867acdfa0e526203dfb4a3261e28743f6b (diff)
downloadperl-8f3c2c0cb1ce993e7d37b84cf6256c76fd3a298a.tar.gz
fix a coredump caused by rv2gv not fully converting a PV to an RV
p4raw-id: //depot/perl@22746
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 6a17ece5c7..1a35902439 100644
--- a/pp.c
+++ b/pp.c
@@ -168,6 +168,12 @@ PP(pp_rv2gv)
}
if (SvTYPE(sv) < SVt_RV)
sv_upgrade(sv, SVt_RV);
+ if (SvPVX(sv)) {
+ (void)SvOOK_off(sv); /* backoff */
+ if (SvLEN(sv))
+ Safefree(SvPVX(sv));
+ SvLEN(sv)=SvCUR(sv)=0;
+ }
SvRV(sv) = (SV*)gv;
SvROK_on(sv);
SvSETMAGIC(sv);