summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index cc8fe4af62..207b955aed 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))) {