This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp.c:pp_clonecv: Use find_runcv to find the padname
authorFather Chrysostomos <sprout@cpan.org>
Sun, 16 Sep 2012 07:20:07 +0000 (00:20 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 17 Sep 2012 23:57:51 +0000 (16:57 -0700)
See: https://rt.perl.org/rt3/Ticket/Display.html?id=113930#txn-1153156

By using find_runcv, we can revert d2c8bf052f.  This may not be the
best tradeoff in the long run, as it makes code using experimental my
subs (my experimental subs?) slower.  But at least we avoid slowing
down existing code.

pp.c

diff --git a/pp.c b/pp.c
index e587f7d..f99c460 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -163,7 +163,8 @@ PP(pp_clonecv)
 {
     dVAR; dTARGET;
     MAGIC * const mg =
-       mg_find(AvARRAY(PL_comppad_name)[ARGTARG], PERL_MAGIC_proto);
+       mg_find(PadlistNAMESARRAY(CvPADLIST(find_runcv(NULL)))[ARGTARG],
+               PERL_MAGIC_proto);
     assert(SvTYPE(TARG) == SVt_PVCV);
     assert(mg);
     assert(mg->mg_obj);