diff options
author | David Mitchell <davem@iabyn.com> | 2015-10-15 15:39:42 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-02-03 08:59:44 +0000 |
commit | 4d37acbf1ccc77a664975c7981614e4341519db9 (patch) | |
tree | a4200c7df4b218c23d8564c8845fccdcba0a0aa7 /pp.c | |
parent | 7e27c4a5349f1a80c7b06064041cb4750b9ed6a6 (diff) | |
download | perl-4d37acbf1ccc77a664975c7981614e4341519db9.tar.gz |
pp_coreargs: rationalise @_ code
Make the code in pp_coreargs that cleans up @_ more like the code in
POPSUB, so that the two can eventually be extracted out into a common
macro.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -6444,15 +6444,20 @@ PP(pp_coreargs) this corresponds to the part of POPSUB that does @_ cleanup */ PERL_CONTEXT *cx = &cxstack[cxstack_ix]; - AV *av = MUTABLE_AV(PAD_SVl(0)); - POP_SAVEARRAY(); - cx->cx_type &= ~ CXp_HASARGS; - assert(AvARRAY(MUTABLE_AV( - PadlistARRAY(CvPADLIST(cx->blk_sub.cv))[ - CvDEPTH(cx->blk_sub.cv)])) == PL_curpad); - - assert(!AvREAL(av)); - CLEAR_ARGARRAY(av); + + assert(CxHASARGS(cx)); + { + AV *av; + assert(AvARRAY(MUTABLE_AV( + PadlistARRAY(CvPADLIST(cx->blk_sub.cv))[ + CvDEPTH(cx->blk_sub.cv)])) == PL_curpad); + POP_SAVEARRAY(); + av = MUTABLE_AV(PAD_SVl(0)); + assert(!AvREAL(av)); + CLEAR_ARGARRAY(av); + } + + cx->cx_type &= ~CXp_HASARGS; } } break; |