summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-10-15 15:39:42 +0100
committerDavid Mitchell <davem@iabyn.com>2016-02-03 08:59:44 +0000
commit4d37acbf1ccc77a664975c7981614e4341519db9 (patch)
treea4200c7df4b218c23d8564c8845fccdcba0a0aa7 /pp.c
parent7e27c4a5349f1a80c7b06064041cb4750b9ed6a6 (diff)
downloadperl-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.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/pp.c b/pp.c
index 8900706160..61b1b29a5b 100644
--- a/pp.c
+++ b/pp.c
@@ -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;