From: Father Chrysostomos Date: Fri, 6 Feb 2015 13:48:46 +0000 (+0100) Subject: Don’t use CvPADLIST on XSUBs X-Git-Tag: rt100264 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=f021f500a256b019fc4b9cefd10d8befae3d1a3d;p=perl%2Fmodules%2FScope-Upper.git Don’t use CvPADLIST on XSUBs That field has been repurposed for XSUBs in perl 5.21.7. It used to be ignored for older perls. This fixes RT #100264. --- diff --git a/Upper.xs b/Upper.xs index 662f246..2739709 100644 --- a/Upper.xs +++ b/Upper.xs @@ -1537,8 +1537,10 @@ STATIC void su_uplevel_restore(pTHX_ void *sus_) { * depth to be 0, or perl would complain about it being "still in use". * But we *know* that it cannot be so. */ if (sud->renamed) { - CvDEPTH(sud->renamed) = 0; - CvPADLIST(sud->renamed) = NULL; + if (!CvISXSUB(sud->renamed)) { + CvDEPTH(sud->renamed) = 0; + CvPADLIST(sud->renamed) = NULL; + } SvREFCNT_dec(sud->renamed); } @@ -1692,13 +1694,13 @@ STATIC CV *su_cv_clone(pTHX_ CV *proto, GV *gv) { CvROOT(cv) = OpREFCNT_inc(CvROOT(proto)); OP_REFCNT_UNLOCK; CvSTART(cv) = CvSTART(proto); + CvPADLIST(cv) = CvPADLIST(proto); } CvOUTSIDE(cv) = CvOUTSIDE(proto); #ifdef CVf_WEAKOUTSIDE if (!(CvFLAGS(proto) & CVf_WEAKOUTSIDE)) #endif SvREFCNT_inc_simple_void(CvOUTSIDE(cv)); - CvPADLIST(cv) = CvPADLIST(proto); #ifdef CvOUTSIDE_SEQ CvOUTSIDE_SEQ(cv) = CvOUTSIDE_SEQ(proto); #endif