* The context frame holds a reference to the CV so that it can't be
* freed while we're executing it */
-#define PUSHSUB_BASE(cx, cv, hasargs) \
+#define PUSHSUB_BASE(cx, cv, op, hasargs) \
ENTRY_PROBE(CvNAMED(cv) \
? HEK_KEY(CvNAME_HEK(cv)) \
: GvENAME(CvGV(cv)), \
cx->blk_sub.olddepth = CvDEPTH(cv); \
cx->blk_sub.prevcomppad = PL_comppad; \
cx->cx_type |= (hasargs) ? CXp_HASARGS : 0; \
- cx->blk_sub.retop = NULL; \
+ cx->blk_sub.retop = op; \
SvREFCNT_inc_simple_void_NN(cv);
#define PUSHSUB_GET_LVALUE_MASK(func) \
? 0 : (U8)func(aTHX) \
)
-#define PUSHSUB(cx, cv, hasargs) \
+#define PUSHSUB(cx, cv, op, hasargs) \
{ \
U8 phlags = PUSHSUB_GET_LVALUE_MASK(Perl_was_lvalue_sub); \
- PUSHSUB_BASE(cx, cv, hasargs) \
+ PUSHSUB_BASE(cx, cv, op, hasargs) \
cx->blk_u16 = PL_op->op_private & \
(phlags|OPpDEREF); \
}
/* variant for use by OP_DBSTATE, where op_private holds hint bits */
-#define PUSHSUB_DB(cx, cv, hasargs) \
- PUSHSUB_BASE(cx, cv, hasargs) \
+#define PUSHSUB_DB(cx, cv, op, hasargs) \
+ PUSHSUB_BASE(cx, cv, op, hasargs) \
cx->blk_u16 = 0;
PUSHSTACKi(PERLSI_MULTICALL); \
PUSHBLOCK(cx, (CXt_SUB|CXp_MULTICALL|flags), gimme, \
PL_stack_sp, PL_savestack_ix); \
- PUSHSUB(cx, cv, hasargs); \
+ PUSHSUB(cx, cv, NULL, hasargs); \
SAVEOP(); \
saveix_floor = PL_savestack_ix; \
if (!(flags & CXp_SUB_RE_FAKE)) \
assert(CxMULTICALL(cx)); \
CX_POPSUB_COMMON(cx); \
cx->cx_type = (CXt_SUB|CXp_MULTICALL|flags); \
- PUSHSUB(cx, cv, hasargs); \
+ PUSHSUB(cx, cv, NULL, hasargs); \
if (!(flags & CXp_SUB_RE_FAKE)) \
CvDEPTH(cv)++; \
if (CvDEPTH(cv) >= 2) \
gimme = GIMME_V;
PUSHBLOCK(cx, CXt_SUB, gimme, MARK, old_savestack_ix);
hasargs = cBOOL(PL_op->op_flags & OPf_STACKED);
- PUSHSUB(cx, cv, hasargs);
- cx->blk_sub.retop = PL_op->op_next;
+ PUSHSUB(cx, cv, PL_op->op_next, hasargs);
padlist = CvPADLIST(cv);
if (UNLIKELY((depth = ++CvDEPTH(cv)) >= 2))
PUSHBLOCK(cx, CXt_NULL, gimme, PL_stack_base, old_savestack_ix);
if (!(flags & OPf_SPECIAL)) {
cx->cx_type = CXt_SUB|CXp_MULTICALL;
- PUSHSUB(cx, cv, hasargs);
+ PUSHSUB(cx, cv, NULL, hasargs);
if (!is_xsub) {
PADLIST * const padlist = CvPADLIST(cv);