From f130fd4589cf5fbb24149cd4db4137c8326f49c1 Mon Sep 17 00:00:00 2001 From: Nick Ing-Simmons Date: Fri, 6 Oct 2000 20:48:34 +0000 Subject: [PATCH] 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 --- sv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); -- 2.7.4