This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make POPSUBST not cxstack_ix--
authorDavid Mitchell <davem@iabyn.com>
Thu, 15 Oct 2015 13:36:59 +0000 (14:36 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 08:59:43 +0000 (08:59 +0000)
For consistency with with the new POPBLOCK, make POPSUBST(cx) no longer
set c nor decrement cxstack_ix. This also makes dounwind more consistent.

cop.h
pp_ctl.c

diff --git a/cop.h b/cop.h
index e1f429d..ab9c016 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -982,7 +982,7 @@ struct subst {
        (void)ReREFCNT_inc(rx);                                         \
         SvREFCNT_inc_void_NN(targ)
 
-#  define POPSUBST(cx) cx = &cxstack[cxstack_ix--];                    \
+#  define POPSUBST(cx) \
        rxres_free(&cx->sb_rxres);                                      \
        ReREFCNT_dec(cx->sb_rx);                                        \
         SvREFCNT_dec_NN(cx->sb_targ)
index 5c57580..8985116 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -285,8 +285,11 @@ PP(pp_substcont)
            /* PL_tainted must be correctly set for this mg_set */
            SvSETMAGIC(TARG);
            TAINT_NOT;
+
            CX_LEAVE_SCOPE(cx);
            POPSUBST(cx);
+            cxstack_ix--;
+
            PERL_ASYNC_CHECK();
            RETURNOP(pm->op_next);
            NOT_REACHED; /* NOTREACHED */
@@ -1516,7 +1519,7 @@ Perl_dounwind(pTHX_ I32 cxix)
        switch (CxTYPE(cx)) {
        case CXt_SUBST:
            POPSUBST(cx);
-           continue;  /* not break */
+           break;
        case CXt_SUB:
            POPSUB(cx);
            break;