From: Dave Mitchell Date: Tue, 27 Apr 2004 22:21:35 +0000 (+0000) Subject: fix a coredump caused by rv2gv not fully converting a PV to an RV X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f3c2c0cb1ce993e7d37b84cf6256c76fd3a298a;p=p5sagit%2Fp5-mst-13.2.git fix a coredump caused by rv2gv not fully converting a PV to an RV p4raw-id: //depot/perl@22746 --- diff --git a/pp.c b/pp.c index 6a17ece..1a35902 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);