diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-02 22:40:25 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-02 22:40:25 -0800 |
commit | 27a98972c3ecd4cc2ad9b26f8e168d4d2547ed7d (patch) | |
tree | 1056862831100223336664d3e426024bf2831d65 | |
parent | 9c607b0b93b14253f2f4b80462a7682d9b934517 (diff) | |
download | perl-sprout/POPBLOCK_normal.tar.gz |
Merge POPBLOCK and POPBLOCK_normalsprout/POPBLOCK_normal
They are almost identical.
-rw-r--r-- | cop.h | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -868,23 +868,21 @@ struct block { DEBUG_CX("PUSH"); /* Exit a block at the end of its normal lifetime */ -#define POPBLOCK_normal(cx,pm) \ - DEBUG_CX("POP"); \ - cx = &cxstack[cxstack_ix--], \ - newsp = PL_stack_base + cx->blk_oldsp, \ - PL_curcop = cx->blk_oldcop, \ - assert(PL_markstack_ptr == PL_markstack + cx->blk_oldmarksp), \ - PL_scopestack_ix = cx->blk_oldscopesp, \ - pm = cx->blk_oldpm, \ - gimme = cx->blk_gimme; +#define POPBLOCK_normal(cx,pm) POPBLOCK_common(cx,pm,1) /* Exit a block (RETURN and LAST). */ -#define POPBLOCK(cx,pm) \ +#define POPBLOCK(cx,pm) POPBLOCK_common(cx,pm,0) + +/* Do not use this macro, as its name may change, or it may vanish in a + puff of smoke. */ +#define POPBLOCK_common(cx,pm,normalcy) \ DEBUG_CX("POP"); \ cx = &cxstack[cxstack_ix--], \ newsp = PL_stack_base + cx->blk_oldsp, \ PL_curcop = cx->blk_oldcop, \ - PL_markstack_ptr = PL_markstack + cx->blk_oldmarksp, \ + normalcy \ + ? assert(PL_markstack_ptr == PL_markstack + cx->blk_oldmarksp) \ + : (PL_markstack_ptr = PL_markstack + cx->blk_oldmarksp), \ PL_scopestack_ix = cx->blk_oldscopesp, \ pm = cx->blk_oldpm, \ gimme = cx->blk_gimme; |