From: Nicholas Clark Date: Sun, 30 Mar 2003 00:35:48 +0000 (+0000) Subject: COW formats (was Re: Smoke [5.9.0] 19044 FAIL(F) linux 2.4.18-3 (i686/1 cpu)) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d89fc664c30eab1bd50f084f75c9996f69a7b7d0;p=p5sagit%2Fp5-mst-13.2.git COW formats (was Re: Smoke [5.9.0] 19044 FAIL(F) linux 2.4.18-3 (i686/1 cpu)) Message-ID: <20030330003547.GO274@Bagpuss.unfortu.net> p4raw-id: //depot/perl@19083 --- diff --git a/sv.c b/sv.c index 1fdd0c2..e7ec8e7 100644 --- a/sv.c +++ b/sv.c @@ -3683,8 +3683,16 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) goto glob_assign; } break; - case SVt_PV: case SVt_PVFM: +#ifdef PERL_COPY_ON_WRITE + if ((SvFLAGS(sstr) & CAN_COW_MASK) == CAN_COW_FLAGS) { + if (dtype < SVt_PVIV) + sv_upgrade(dstr, SVt_PVIV); + break; + } + /* Fall through */ +#endif + case SVt_PV: if (dtype < SVt_PV) sv_upgrade(dstr, SVt_PV); break; @@ -4006,6 +4014,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) /* making another shared SV. */ STRLEN cur = SvCUR(sstr); STRLEN len = SvLEN(sstr); + assert (SvTYPE(dstr) >= SVt_PVIV); if (len) { /* SvIsCOW_normal */ /* splice us in between source and next-after-source. */