summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-12-26 11:39:30 +0000
committerDavid Mitchell <davem@iabyn.com>2016-02-03 09:19:18 +0000
commitfd9b7244731b18bb1794c4ff6540e4040e51879b (patch)
treecafd34f6763a5bbb13041545bfaa905b62363fc8
parent47878d9caf766872f9956edf713aa65c5b6383aa (diff)
downloadperl-fd9b7244731b18bb1794c4ff6540e4040e51879b.tar.gz
PUSHBLOCK: don't use implicit args
Make gimme a parameter of PUSHBLOCK() rather than just assuming that there's a 'gimme' var in scope.
-rw-r--r--cop.h6
-rw-r--r--pp_ctl.c18
-rw-r--r--pp_hot.c2
-rw-r--r--pp_sort.c2
-rw-r--r--pp_sys.c2
5 files changed, 15 insertions, 15 deletions
diff --git a/cop.h b/cop.h
index f58e89c2ce..1fa485eb73 100644
--- a/cop.h
+++ b/cop.h
@@ -961,7 +961,7 @@ struct block {
__FILE__, __LINE__));
/* Enter a block. */
-#define PUSHBLOCK(cx,t,sp, saveix) \
+#define PUSHBLOCK(cx, t, gimme, sp, saveix) \
CXINC, \
cx = CX_CUR(), \
cx->cx_type = t, \
@@ -1343,8 +1343,8 @@ See L<perlcall/LIGHTWEIGHT CALLBACKS>.
multicall_oldcatch = CATCH_GET; \
CATCH_SET(TRUE); \
PUSHSTACKi(PERLSI_MULTICALL); \
- PUSHBLOCK(cx, (CXt_SUB|CXp_MULTICALL|flags), PL_stack_sp, \
- PL_savestack_ix); \
+ PUSHBLOCK(cx, (CXt_SUB|CXp_MULTICALL|flags), gimme, \
+ PL_stack_sp, PL_savestack_ix); \
PUSHSUB(cx); \
SAVEOP(); \
saveix_floor = PL_savestack_ix; \
diff --git a/pp_ctl.c b/pp_ctl.c
index 1f4786f766..f5739687b9 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2014,7 +2014,7 @@ PP(pp_dbstate)
}
else {
U8 hasargs = 0;
- PUSHBLOCK(cx, CXt_SUB, SP, PL_savestack_ix);
+ PUSHBLOCK(cx, CXt_SUB, gimme, SP, PL_savestack_ix);
PUSHSUB_DB(cx);
cx->blk_sub.retop = PL_op->op_next;
@@ -2039,7 +2039,7 @@ PP(pp_enter)
PERL_CONTEXT *cx;
I32 gimme = GIMME_V;
- PUSHBLOCK(cx, CXt_BLOCK, SP, PL_savestack_ix);
+ PUSHBLOCK(cx, CXt_BLOCK, gimme, SP, PL_savestack_ix);
PUSHBASICBLK(cx);
RETURN;
@@ -2139,7 +2139,7 @@ PP(pp_enteriter)
/* OPpITER_DEF (implicit $_) should only occur with a GV iter var */
assert((cxflags & CXp_FOR_GV) || !(PL_op->op_private & OPpITER_DEF));
- PUSHBLOCK(cx, cxflags, MARK, PL_savestack_ix);
+ PUSHBLOCK(cx, cxflags, gimme, MARK, PL_savestack_ix);
PUSHLOOP_FOR(cx, itervarp, itersave);
if (PL_op->op_flags & OPf_STACKED) {
@@ -2214,7 +2214,7 @@ PP(pp_enterloop)
PERL_CONTEXT *cx;
const I32 gimme = GIMME_V;
- PUSHBLOCK(cx, CXt_LOOP_PLAIN, SP, PL_savestack_ix);
+ PUSHBLOCK(cx, CXt_LOOP_PLAIN, gimme, SP, PL_savestack_ix);
PUSHLOOP_PLAIN(cx);
RETURN;
@@ -4043,7 +4043,7 @@ PP(pp_require)
}
/* switch to eval mode */
- PUSHBLOCK(cx, CXt_EVAL, SP, old_savestack_ix);
+ PUSHBLOCK(cx, CXt_EVAL, gimme, SP, old_savestack_ix);
PUSHEVAL(cx, name);
cx->blk_eval.retop = PL_op->op_next;
@@ -4158,7 +4158,7 @@ PP(pp_entereval)
* to do the dirty work for us */
runcv = find_runcv(&seq);
- PUSHBLOCK(cx, (CXt_EVAL|CXp_REAL), SP, old_savestack_ix);
+ PUSHBLOCK(cx, (CXt_EVAL|CXp_REAL), gimme, SP, old_savestack_ix);
PUSHEVAL(cx, 0);
cx->blk_eval.retop = PL_op->op_next;
@@ -4289,7 +4289,7 @@ Perl_create_eval_scope(pTHX_ U32 flags)
PERL_CONTEXT *cx;
const I32 gimme = GIMME_V;
- PUSHBLOCK(cx, (CXt_EVAL|CXp_TRYBLOCK), PL_stack_sp, PL_savestack_ix);
+ PUSHBLOCK(cx, (CXt_EVAL|CXp_TRYBLOCK), gimme, PL_stack_sp, PL_savestack_ix);
PUSHEVAL(cx, 0);
PL_in_eval = EVAL_INEVAL;
@@ -4349,7 +4349,7 @@ PP(pp_entergiven)
assert(!PL_op->op_targ); /* used to be set for lexical $_ */
GvSV(PL_defgv) = SvREFCNT_inc(newsv);
- PUSHBLOCK(cx, CXt_GIVEN, SP, PL_savestack_ix);
+ PUSHBLOCK(cx, CXt_GIVEN, gimme, SP, PL_savestack_ix);
PUSHGIVEN(cx, origsv);
RETURN;
@@ -4929,7 +4929,7 @@ PP(pp_enterwhen)
if ((0 == (PL_op->op_flags & OPf_SPECIAL)) && !SvTRUEx(POPs))
RETURNOP(cLOGOP->op_other->op_next);
- PUSHBLOCK(cx, CXt_WHEN, SP, PL_savestack_ix);
+ PUSHBLOCK(cx, CXt_WHEN, gimme, SP, PL_savestack_ix);
PUSHWHEN(cx);
RETURN;
diff --git a/pp_hot.c b/pp_hot.c
index 127e5624ae..647e398e6c 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -3852,7 +3852,7 @@ PP(pp_entersub)
}
gimme = GIMME_V;
- PUSHBLOCK(cx, CXt_SUB, MARK, old_savestack_ix);
+ PUSHBLOCK(cx, CXt_SUB, gimme, MARK, old_savestack_ix);
hasargs = cBOOL(PL_op->op_flags & OPf_STACKED);
PUSHSUB(cx);
cx->blk_sub.retop = PL_op->op_next;
diff --git a/pp_sort.c b/pp_sort.c
index 65609da5fe..e910662794 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1668,7 +1668,7 @@ PP(pp_sort)
}
gimme = G_SCALAR;
- PUSHBLOCK(cx, CXt_NULL, PL_stack_base, old_savestack_ix);
+ PUSHBLOCK(cx, CXt_NULL, gimme, PL_stack_base, old_savestack_ix);
if (!(flags & OPf_SPECIAL)) {
cx->cx_type = CXt_SUB|CXp_MULTICALL;
PUSHSUB(cx);
diff --git a/pp_sys.c b/pp_sys.c
index 74fede749d..901cfe5206 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1389,7 +1389,7 @@ S_doform(pTHX_ CV *cv, GV *gv, OP *retop)
if (CvCLONE(cv))
cv = MUTABLE_CV(sv_2mortal(MUTABLE_SV(cv_clone(cv))));
- PUSHBLOCK(cx, CXt_FORMAT, PL_stack_sp, PL_savestack_ix);
+ PUSHBLOCK(cx, CXt_FORMAT, gimme, PL_stack_sp, PL_savestack_ix);
PUSHFORMAT(cx, retop);
if (CvDEPTH(cv) >= 2)
pad_push(CvPADLIST(cv), CvDEPTH(cv));