From: Doug MacEachern Date: Sun, 9 Jun 2002 14:00:39 +0000 (-0700) Subject: Re: unique attribute? X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=37e207062507be5a69b0c6788e42ed691679a307;p=p5sagit%2Fp5-mst-13.2.git Re: unique attribute? Message-ID: p4raw-id: //depot/perl@17146 --- diff --git a/sv.c b/sv.c index 18fdfc1..d139ccf 100644 --- a/sv.c +++ b/sv.c @@ -8872,7 +8872,7 @@ S_gv_share(pTHX_ SV *sstr) } else { /* CvPADLISTs cannot be shared */ - if (!CvXSUB(GvCV(gv))) { + if (!SvREADONLY(GvCV(gv)) && !CvXSUB(GvCV(gv))) { GvUNIQUE_off(gv); } } @@ -9056,6 +9056,7 @@ Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param) if ((share = gv_share(sstr))) { del_SV(dstr); dstr = share; + ptr_table_store(PL_ptr_table, sstr, dstr); #if 0 PerlIO_printf(Perl_debug_log, "sv_dup: sharing %s::%s\n", HvNAME(GvSTASH(share)), GvNAME(share));