summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2003-03-30 00:35:48 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-03-30 07:49:46 +0000
commitd89fc664c30eab1bd50f084f75c9996f69a7b7d0 (patch)
tree9ce67a44d9883e9b9bb89748f31d15b77936d7a0 /sv.c
parent3b8fd1d50fa2d1e7d187a495bdbd1c1584f6a531 (diff)
downloadperl-d89fc664c30eab1bd50f084f75c9996f69a7b7d0.tar.gz
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
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 1fdd0c2e33..e7ec8e7e7f 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. */