From: Jarkko Hietaniemi Date: Sat, 30 Jun 2001 13:15:59 +0000 (+0000) Subject: The #11040 had slipped to a wrong function... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=05bd410391c3da3a732fa3cd37852e51526dd8b4;p=p5sagit%2Fp5-mst-13.2.git The #11040 had slipped to a wrong function... p4raw-id: //depot/perl@11043 --- diff --git a/sv.c b/sv.c index 207b955..ef04687 100644 --- a/sv.c +++ b/sv.c @@ -8440,6 +8440,18 @@ Perl_mg_dup(pTHX_ MAGIC *mg, clone_params* param) if (mg->mg_type == PERL_MAGIC_qr) { nmg->mg_obj = (SV*)re_dup((REGEXP*)mg->mg_obj); } + 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 { nmg->mg_obj = (mg->mg_flags & MGf_REFCOUNTED) ? sv_dup_inc(mg->mg_obj, param) @@ -8628,18 +8640,6 @@ 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))) {