From: Vincent Pit Date: Tue, 13 Sep 2011 17:34:16 +0000 (+0200) Subject: In su_cv_clone(), add stash->cloned_cv backrefs on perl 5.13.x X-Git-Tag: v0.17~12 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=0c97db2a770d864d7486d493ebaa010dc77e8279;p=perl%2Fmodules%2FScope-Upper.git In su_cv_clone(), add stash->cloned_cv backrefs on perl 5.13.x This fixes test failures on debugging perl 5.13.[456]. --- 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));