diff options
-rw-r--r-- | dump.c | 5 | ||||
-rw-r--r-- | op.c | 1 | ||||
-rw-r--r-- | op.h | 3 | ||||
-rw-r--r-- | pp.h | 2 |
4 files changed, 9 insertions, 2 deletions
@@ -472,8 +472,11 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o) 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; @@ -5624,6 +5624,7 @@ Perl_ck_subr(pTHX_ OP *o) 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; @@ -117,13 +117,14 @@ typedef U32 PADOFFSET; /* 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) */ @@ -49,6 +49,8 @@ #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 |