The #11040 had slipped to a wrong function...
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 30 Jun 2001 13:15:59 +0000 (13:15 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 30 Jun 2001 13:15:59 +0000 (13:15 +0000)
p4raw-id: //depot/perl@11043

sv.c

diff --git a/sv.c b/sv.c
index 207b955..ef04687 100644 (file)
--- 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))) {