NAMECNT should be cloned in cv_clone,
authorPeter Martini <PeterCMartini@GMail.com>
Tue, 16 Oct 2012 17:01:03 +0000 (13:01 -0400)
committerPeter Martini <PeterCMartini@GMail.com>
Wed, 17 Oct 2012 20:36:16 +0000 (16:36 -0400)
otherwise closures won't have the pad init properly

pad.c

diff --git a/pad.c b/pad.c
index 76512b3..8cdefde 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -2022,6 +2022,7 @@ S_cv_clone_pad(pTHX_ CV *proto, CV *cv, CV *outside)
     PL_comppad_name = protopad_name;
     CvPADLIST(cv) = pad_new(padnew_CLONE|padnew_SAVE);
     CvPADLIST(cv)->xpadl_id = protopadlist->xpadl_id;
+    PadlistNAMECNT(CvPADLIST(cv)) = PadlistNAMECNT(protopadlist);
 
     av_fill(PL_comppad, fpad);