sv_catpv(tmpsv, ",AMPER");
if (o->op_private & OPpENTERSUB_DB)
sv_catpv(tmpsv, ",DB");
+ if (o->op_private & OPpENTERSUB_HASTARG)
+ sv_catpv(tmpsv, ",HASTARG");
}
- switch (o->op_private & OPpDEREF) {
+ else
+ switch (o->op_private & OPpDEREF) {
case OPpDEREF_SV:
sv_catpv(tmpsv, ",SV");
break;
I32 arg = 0;
STRLEN n_a;
+ o->op_private |= OPpENTERSUB_HASTARG;
for (cvop = o2; cvop->op_sibling; cvop = cvop->op_sibling) ;
if (cvop->op_type == OP_RV2CV) {
SVOP* tmpop;
/* Private for OP_REPEAT */
#define OPpREPEAT_DOLIST 64 /* List replication. */
-/* Private for OP_ENTERSUB, OP_RV2?V, OP_?ELEM */
+/* Private for OP_RV2?V, OP_?ELEM */
#define OPpDEREF (32|64) /* Want ref to something: */
#define OPpDEREF_AV 32 /* Want ref to AV. */
#define OPpDEREF_HV 64 /* Want ref to HV. */
#define OPpDEREF_SV (32|64) /* Want ref to SV. */
/* OP_ENTERSUB only */
#define OPpENTERSUB_DB 16 /* Debug subroutine. */
+#define OPpENTERSUB_HASTARG 32 /* Called from OP tree. */
/* OP_RV2CV only */
#define OPpENTERSUB_AMPER 8 /* Used & form to call. */
#define OPpENTERSUB_NOPAREN 128 /* bare sub call (without parens) */
#define dTARG SV *targ
+#define dXS_TARGET SV * targ = (PL_op->op_private & OPpENTERSUB_HASTARG ? PAD_SV(PL_op->op_targ) : sv_newmortal())
+
#define NORMAL PL_op->op_next
#define DIE return Perl_die