X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=blobdiff_plain;f=Upper.xs;h=27397091936b248267348e9bbe075f900311671f;hp=497b70e5ce51055f008e59937fa9b1c35906641d;hb=3beb96a81eebadf62454ea90eecd4b9dd36bdce5;hpb=83fcc5faed4fc157a242911f96a5c97095dd2899 diff --git a/Upper.xs b/Upper.xs index 497b70e..2739709 100644 --- a/Upper.xs +++ b/Upper.xs @@ -197,8 +197,12 @@ STATIC U8 su_op_gimme_reverse(U8 gimme) { #define OP_GIMME_REVERSE(G) su_op_gimme_reverse(G) #endif -#ifndef OP_SIBLING -# define OP_SIBLING(O) ((O)->op_sibling) +#ifndef OpSIBLING +# ifdef OP_SIBLING +# define OpSIBLING(O) OP_SIBLING(O) +# else +# define OpSIBLING(O) ((O)->op_sibling) +# endif #endif #ifndef PERL_MAGIC_tied @@ -1405,7 +1409,7 @@ STATIC void su_uplevel_storage_delete(pTHX_ su_uplevel_ud *sud) { } STATIC int su_uplevel_goto_static(const OP *o) { - for (; o; o = OP_SIBLING(o)) { + for (; o; o = OpSIBLING(o)) { /* goto ops are unops with kids. */ if (!(o->op_flags & OPf_KIDS)) continue; @@ -1533,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); } @@ -1668,6 +1674,9 @@ STATIC CV *su_cv_clone(pTHX_ CV *proto, GV *gv) { #endif CvGV_set(cv, gv); +#if SU_RELEASE && SU_HAS_PERL_EXACT(5, 21, 4) + CvNAMED_off(cv); +#endif 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 @@ -1685,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 @@ -2097,8 +2106,8 @@ STATIC I32 su_context_normalize_up(pTHX_ I32 cxix) { return cxix - 1; break; case CXt_SUBST: - if (cx->blk_oldcop && OP_SIBLING(cx->blk_oldcop) - && OP_SIBLING(cx->blk_oldcop)->op_type == OP_SUBST) + if (cx->blk_oldcop && OpSIBLING(cx->blk_oldcop) + && OpSIBLING(cx->blk_oldcop)->op_type == OP_SUBST) return cxix - 1; break; } @@ -2133,8 +2142,8 @@ STATIC I32 su_context_normalize_down(pTHX_ I32 cxix) { return cxix + 1; break; case CXt_SUBST: - if (next->blk_oldcop && OP_SIBLING(next->blk_oldcop) - && OP_SIBLING(next->blk_oldcop)->op_type == OP_SUBST) + if (next->blk_oldcop && OpSIBLING(next->blk_oldcop) + && OpSIBLING(next->blk_oldcop)->op_type == OP_SUBST) return cxix + 1; break; } @@ -2164,8 +2173,8 @@ STATIC I32 su_context_gimme(pTHX_ I32 cxix) { #endif case CXt_SUBST: { const COP *cop = cx->blk_oldcop; - if (cop && OP_SIBLING(cop)) { - switch (OP_SIBLING(cop)->op_flags & OPf_WANT) { + if (cop && OpSIBLING(cop)) { + switch (OpSIBLING(cop)->op_flags & OPf_WANT) { case OPf_WANT_VOID: return G_VOID; case OPf_WANT_SCALAR: @@ -2375,7 +2384,6 @@ XS(XS_Scope__Upper_leave) { dXSARGS; #endif dMY_CXT; - I32 cxix; PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */