X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Upper.xs;h=cff207a5fe8547b496d05cbf29c6ed8b4ec0f9ce;hb=0c97db2a770d864d7486d493ebaa010dc77e8279;hp=bb380fe56e97cf591671543ff52478813c599dc7;hpb=f096bbc131e6ca04b079a22f2e48efff1a6c3ddb;p=perl%2Fmodules%2FScope-Upper.git diff --git a/Upper.xs b/Upper.xs index bb380fe..cff207a 100644 --- a/Upper.xs +++ b/Upper.xs @@ -1179,6 +1179,13 @@ STATIC CV *su_cv_clone(pTHX_ CV *proto, GV *gv) { CvGV_set(cv, gv); CvSTASH_set(cv, CvSTASH(proto)); + /* Commit 4c74a7df, publicized with perl 5.13.3, began to add backrefs to + * stashes. CvSTASH_set() started to do it as well with commit c68d95645 + * (which was part of perl 5.13.7). */ +#if SU_HAS_PERL(5, 13, 3) && !SU_HAS_PERL(5, 13, 7) + if (CvSTASH(proto)) + Perl_sv_add_backref(aTHX_ CvSTASH(proto), MUTABLE_SV(cv)); +#endif OP_REFCNT_LOCK; CvROOT(cv) = OpREFCNT_inc(CvROOT(proto));