From: Nick Ing-Simmons Date: Fri, 6 Oct 2000 20:48:34 +0000 (+0000) Subject: Fix in change 7162 was too-late for case where we "upgraded" to PVIV and X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f130fd4589cf5fbb24149cd4db4137c8326f49c1;p=p5sagit%2Fp5-mst-13.2.git Fix in change 7162 was too-late for case where we "upgraded" to PVIV and got a false +ve and so did not reach code which would have un-FAKEd the SV. p4raw-id: //depot/perl@7163 --- diff --git a/sv.c b/sv.c index 633c30d..a2e6fbd 100644 --- a/sv.c +++ b/sv.c @@ -913,6 +913,10 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) MAGIC* magic; HV* stash; + if (mt != SVt_PV && SvREADONLY(sv) && SvFAKE(sv)) { + sv_force_normal(sv); + } + if (SvTYPE(sv) == mt) return TRUE; @@ -981,9 +985,6 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) mt = SVt_PVNV; break; case SVt_PVIV: - if (SvREADONLY(sv) && SvFAKE(sv)) { - sv_force_normal(sv); - } pv = SvPVX(sv); cur = SvCUR(sv); len = SvLEN(sv);