summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
Diffstat (limited to 'op.c')
-rw-r--r--op.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/op.c b/op.c
index 606e086825..02811c622e 100644
--- a/op.c
+++ b/op.c
@@ -7685,7 +7685,16 @@ Perl_ck_fun(pTHX_ OP *o)
tokid = &kid->op_sibling;
kid = kid->op_sibling;
}
- if (kid && kid->op_type == OP_COREARGS) return o;
+ if (kid && kid->op_type == OP_COREARGS) {
+ bool optional = FALSE;
+ while (oa) {
+ numargs++;
+ if (oa & OA_OPTIONAL) optional = TRUE;
+ oa = oa >> 4;
+ }
+ if (optional) o->op_private |= numargs;
+ return o;
+ }
while (oa) {
if (oa & OA_OPTIONAL || (oa & 7) == OA_LIST) {