summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-25 14:33:03 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-25 14:33:03 -0700
commitbf0571fdfef93e57e5d288048145a1610dd40938 (patch)
tree14ef3a17b36cd36d65289dd4a85e1fd7713b823e /op.c
parent0b19d81a098d6a9b895996d374ca0adc621f1590 (diff)
downloadperl-bf0571fdfef93e57e5d288048145a1610dd40938.tar.gz
&CORE::foo() for @ and $@ prototypes, except unlink
This commit allows the CORE subroutines for functions with @ and $@ prototypes to be called through references and via amper- sand syntax. unlink is not included in this commit, as it requires special casing due to its use of implicit $_. Since these functions require a pushmark, and since it has to come between two things that pp_coreargs does, it’s easiest to flag the coreargs op (with the OPpCOREARGS_PUSHMARK flag added in the previous commit) and call pp_pushmark directly from pp_coreargs.
Diffstat (limited to 'op.c')
-rw-r--r--op.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/op.c b/op.c
index 973675896b..4f42daa1da 100644
--- a/op.c
+++ b/op.c
@@ -3091,6 +3091,13 @@ Perl_convert(pTHX_ I32 type, I32 flags, OP *o)
if (!(PL_opargs[type] & OA_MARK))
op_null(cLISTOPo->op_first);
+ else {
+ OP * const kid2 = cLISTOPo->op_first->op_sibling;
+ if (kid2 && kid2->op_type == OP_COREARGS) {
+ op_null(cLISTOPo->op_first);
+ kid2->op_private |= OPpCOREARGS_PUSHMARK;
+ }
+ }
o->op_type = (OPCODE)type;
o->op_ppaddr = PL_ppaddr[type];