AvFILLp(ary) = -1; \
} STMT_END
-#define POPSUB(cx,sv) \
+#define POPSUB(cx) \
STMT_START { \
CX_LEAVE_SCOPE(cx); \
if (!(cx->blk_u16 & CxPOPSUB_DONE)) { \
PL_tmps_floor = cx->cx_u.cx_blk.blku_old_tmpsfloor; \
PL_comppad = cx->blk_sub.prevcomppad; \
PL_curpad = LIKELY(PL_comppad) ? AvARRAY(PL_comppad) : NULL; \
- sv = MUTABLE_SV(cx->blk_sub.cv); \
- CvDEPTH((const CV*)sv) = cx->blk_sub.olddepth; \
- } STMT_END
-
-#define LEAVESUB(sv) \
- STMT_START { \
- SvREFCNT_dec(sv); \
+ CvDEPTH((const CV*)cx->blk_sub.cv) = cx->blk_sub.olddepth; \
+ SvREFCNT_dec_NN(cx->blk_sub.cv); \
} STMT_END
#define POPFORMAT(cx) \
CX_LEAVE_SCOPE(cx); \
PL_comppad = cx->blk_sub.prevcomppad; \
PL_curpad = LIKELY(PL_comppad) ? AvARRAY(PL_comppad) : NULL; \
- LEAVESUB(multicall_cv); \
+ SvREFCNT_dec_NN(multicall_cv); \
POPSTACK; \
CATCH_SET(multicall_oldcatch); \
SPAGAIN; \
cx = &cxstack[cxstack_ix]; \
assert(cx->cx_type & CXp_MULTICALL); \
CvDEPTH(multicall_cv) = cx->blk_sub.olddepth; \
- LEAVESUB(multicall_cv); \
+ SvREFCNT_dec_NN(multicall_cv); \
cx->cx_type = (CXt_SUB|CXp_MULTICALL|flags); \
{ \
/* save a few things that we don't want PUSHSUB to zap */ \
return;
while (cxstack_ix > cxix) {
- SV *sv;
PERL_CONTEXT *cx = &cxstack[cxstack_ix];
DEBUG_CX("UNWIND"); \
/* Note: we don't need to restore the base context info till the end. */
POPSUBST(cx);
continue; /* not break */
case CXt_SUB:
- POPSUB(cx,sv);
- LEAVESUB(sv);
+ POPSUB(cx);
break;
case CXt_EVAL:
POPEVAL(cx);
PMOP *newpm;
I32 gimme;
PERL_CONTEXT *cx;
- SV *sv;
bool ref;
const char *what = NULL;
ref = !!(CxLVAL(cx) & OPpENTERSUB_INARGS);
if (gimme == G_SCALAR) {
if (CxLVAL(cx) && !ref) { /* Leave it as it is if we can. */
- SV *sv;
if (MARK <= SP) {
if ((SvPADTMP(TOPs) || SvREADONLY(TOPs)) &&
!SvSMAGICAL(TOPs)) {
what = "undef";
}
croak:
- POPSUB(cx,sv);
- LEAVESUB(sv);
+ POPSUB(cx);
cxstack_ix--;
PL_curpm = cx->blk_oldpm;
Perl_croak(aTHX_
POPBLOCK(cx,newpm);
cxstack_ix++; /* preserve cx entry on stack for use by POPSUB */
- POPSUB(cx,sv); /* Stack values are safe: release CV and @_ ... */
- LEAVESUB(sv);
+ POPSUB(cx); /* Stack values are safe: release CV and @_ ... */
cxstack_ix--;
PL_curpm = newpm; /* ... and pop $1 et al */
PMOP *newpm;
I32 gimme;
PERL_CONTEXT *cx;
- SV *sv;
cx = &cxstack[cxstack_ix];
assert(CxTYPE(cx) == CXt_SUB);
sv_2mortal(*MARK);
}
else {
- sv = SvREFCNT_inc(TOPs); /* FREETMPS could clobber it */
+ SV *sv = SvREFCNT_inc(TOPs); /* FREETMPS could clobber it */
FREETMPS;
*MARK = sv_mortalcopy(sv);
SvREFCNT_dec_NN(sv);
POPBLOCK(cx,newpm);
cxstack_ix++; /* temporarily protect top context */
- POPSUB(cx,sv); /* Stack values are safe: release CV and @_ ... */
- LEAVESUB(sv);
+ POPSUB(cx); /* Stack values are safe: release CV and @_ ... */
cxstack_ix--;
PL_curpm = newpm; /* ... and pop $1 et al */
sort_flags);
if (!(flags & OPf_SPECIAL)) {
- SV *sv;
/* Reset cx, in case the context stack has been
reallocated. */
cx = &cxstack[cxstack_ix];
- POPSUB(cx, sv);
- LEAVESUB(sv);
+ POPSUB(cx);
}
else
/* mimic POPSUB */