Re: unique attribute?
Doug MacEachern [Sun, 9 Jun 2002 14:00:39 +0000 (07:00 -0700)]
Message-ID: <Pine.LNX.4.33.0206091356210.26891-100000@mako.covalent.net>

p4raw-id: //depot/perl@17146

sv.c

diff --git a/sv.c b/sv.c
index 18fdfc1..d139ccf 100644 (file)
--- 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));