CvDEPTH(cx->blk_sub.cv)])) == PL_curpad); \
POP_SAVEARRAY(); \
/* abandon @_ if it got reified */ \
- if (AvREAL(av)) { \
- const SSize_t fill = AvFILLp(av); \
- SvREFCNT_dec_NN(av); \
- av = newAV(); \
- av_extend(av, fill); \
- AvREIFY_only(av); \
- PAD_SVl(0) = MUTABLE_SV(av); \
- } \
+ if (UNLIKELY(AvREAL(av))) \
+ clear_defarray(av, 0); \
else { \
CLEAR_ARGARRAY(av); \
} \
#endif
EMpPX |SV* |_get_encoding
+Xp |void |clear_defarray |NN AV* av|bool abandon
: ex: set ts=8 sts=4 sw=4 noet:
#define ck_svconst(a) Perl_ck_svconst(aTHX_ a)
#define ck_tell(a) Perl_ck_tell(aTHX_ a)
#define ck_trunc(a) Perl_ck_trunc(aTHX_ a)
+#define clear_defarray(a,b) Perl_clear_defarray(aTHX_ a,b)
#define closest_cop(a,b,c,d) Perl_closest_cop(aTHX_ a,b,c,d)
#define core_prototype(a,b,c,d) Perl_core_prototype(aTHX_ a,b,c,d)
#define coresub_op(a,b,c) Perl_coresub_op(aTHX_ a,b,c)
return cx->blk_sub.retop;
}
+
+/* clear (if possible) or abandon the current @_. If 'abandon' is true,
+ * forces an abandon */
+
+void
+Perl_clear_defarray(pTHX_ AV* av, bool abandon)
+{
+ const SSize_t fill = AvFILLp(av);
+
+ PERL_ARGS_ASSERT_CLEAR_DEFARRAY;
+
+ SvREFCNT_dec_NN(av);
+ av = newAV();
+ av_extend(av, fill);
+ AvREIFY_only(av);
+ PAD_SVl(0) = MUTABLE_SV(av);
+}
+
+
PP(pp_entersub)
{
dSP; dPOPss;
PERL_CALLCONV bool Perl_ckwarn(pTHX_ U32 w);
PERL_CALLCONV bool Perl_ckwarn_d(pTHX_ U32 w);
+PERL_CALLCONV void Perl_clear_defarray(pTHX_ AV* av, bool abandon);
+#define PERL_ARGS_ASSERT_CLEAR_DEFARRAY \
+ assert(av)
PERL_CALLCONV const COP* Perl_closest_cop(pTHX_ const COP *cop, const OP *o, const OP *curop, bool opnext);
#define PERL_ARGS_ASSERT_CLOSEST_COP \
assert(cop)