Subject: | [PATCH] Don’t use CvPADLIST on XSUBs |
That field has been repurposed for XSUBs in bleadperl. Scope::Upper now has assertion failures under debugging builds. See the attachment.
Subject: | open_zt8iU2WU.txt |
diff -rup Scope-Upper-0.25-PTRJcS-orig/Upper.xs Scope-Upper-0.25-PTRJcS/Upper.xs
--- Scope-Upper-0.25-PTRJcS-orig/Upper.xs 2014-09-20 09:06:30.000000000 -0700
+++ Scope-Upper-0.25-PTRJcS/Upper.xs 2014-11-10 22:19:40.000000000 -0800
@@ -1533,8 +1533,10 @@ STATIC void su_uplevel_restore(pTHX_ voi
* 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);
}
@@ -1688,13 +1690,13 @@ STATIC CV *su_cv_clone(pTHX_ CV *proto,
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