diff options
author | David Mitchell <davem@iabyn.com> | 2019-09-21 13:23:16 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-09-23 14:11:44 +0100 |
commit | 5b6f744373565ad7bd6bbd484c9e09bc90a0125e (patch) | |
tree | 31cf7039d7564fb1257b439497e1ddb4578b1ba9 /pp_ctl.c | |
parent | 75e935adf0585621c7dfb464674056f199c35824 (diff) | |
download | perl-5b6f744373565ad7bd6bbd484c9e09bc90a0125e.tar.gz |
Un-revert "[MERGE] add+use si_cxsubix field"
original merge commit: v5.31.3-198-gd2cd363728
reverted by: v5.31.4-0-g20ef288c53
The commit following this commit fixes the breakage, which that means
the revert can be undone.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -37,6 +37,11 @@ #define RUN_PP_CATCHABLY(thispp) \ STMT_START { if (CATCH_GET) return docatch(thispp); } STMT_END +#define dopopto_cursub() \ + (PL_curstackinfo->si_cxsubix >= 0 \ + ? PL_curstackinfo->si_cxsubix \ + : dopoptosub_at(cxstack, cxstack_ix)) + #define dopoptosub(plop) dopoptosub_at(cxstack, (plop)) PP(pp_wantarray) @@ -50,7 +55,7 @@ PP(pp_wantarray) if (!(cx = caller_cx(1,NULL))) RETPUSHUNDEF; } else { - cxix = dopoptosub(cxstack_ix); + cxix = dopopto_cursub(); if (cxix < 0) RETPUSHUNDEF; cx = &cxstack[cxix]; @@ -1384,10 +1389,12 @@ Perl_dowantarray(pTHX) return (gimme == G_VOID) ? G_SCALAR : gimme; } +/* note that this function has mostly been superseded by Perl_gimme_V */ + U8 Perl_block_gimme(pTHX) { - const I32 cxix = dopoptosub(cxstack_ix); + const I32 cxix = dopopto_cursub(); U8 gimme; if (cxix < 0) return G_VOID; @@ -1402,7 +1409,7 @@ Perl_block_gimme(pTHX) I32 Perl_is_lvalue_sub(pTHX) { - const I32 cxix = dopoptosub(cxstack_ix); + const I32 cxix = dopopto_cursub(); assert(cxix >= 0); /* We should only be called from inside subs */ if (CxLVAL(cxstack + cxix) && CvLVALUE(cxstack[cxix].blk_sub.cv)) @@ -1860,7 +1867,7 @@ frame for the sub call itself. const PERL_CONTEXT * Perl_caller_cx(pTHX_ I32 count, const PERL_CONTEXT **dbcxp) { - I32 cxix = dopoptosub(cxstack_ix); + I32 cxix = dopopto_cursub(); const PERL_CONTEXT *cx; const PERL_CONTEXT *ccstack = cxstack; const PERL_SI *top_si = PL_curstackinfo; @@ -2462,7 +2469,7 @@ PP(pp_return) { dSP; dMARK; PERL_CONTEXT *cx; - const I32 cxix = dopoptosub(cxstack_ix); + const I32 cxix = dopopto_cursub(); assert(cxstack_ix >= 0); if (cxix < cxstack_ix) { @@ -2833,7 +2840,7 @@ PP(pp_goto) DIE(aTHX_ "Goto undefined subroutine"); } - cxix = dopoptosub(cxstack_ix); + cxix = dopopto_cursub(); if (cxix < 0) { DIE(aTHX_ "Can't goto subroutine outside a subroutine"); } |