From: Artur Bergman Date: Sat, 30 Jun 2001 01:18:16 +0000 (+0200) Subject: weakref fix 2, not yet there X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c74e5284dc2e0dcda5959a5a6ebd0b82a082ddad;p=p5sagit%2Fp5-mst-13.2.git weakref fix 2, not yet there Message-ID: p4raw-id: //depot/perl@11040 --- diff --git a/sv.c b/sv.c index cc8fe4a..207b955 100644 --- a/sv.c +++ b/sv.c @@ -8628,6 +8628,18 @@ S_gv_share(pTHX_ SV *sstr) else if (!GvCV(gv)) { GvCV(gv) = (CV*)sv; } + else if(mg->mg_type == PERL_MAGIC_backref) { + AV *av = (AV*) mg->mg_obj; + SV **svp; + I32 i; + nmg->mg_obj = (SV*)newAV(); + svp = AvARRAY(av); + i = AvFILLp(av); + while (i >= 0) { + av_push((AV*)nmg->mg_obj,sv_dup(svp[i],param)); + i--; + } + } else { /* CvPADLISTs cannot be shared */ if (!CvXSUB(GvCV(gv))) {