summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-21 19:58:43 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-21 19:58:43 -0700
commit72ec8a821beca962b4748ef16cf7f1ce74119c43 (patch)
treec1bc23d97a66c45fd455f3b87d1cefdd696f2b95 /op.c
parentc1ff15b2b4d6172bd224dcc6f444d5f0875cd758 (diff)
downloadperl-72ec8a821beca962b4748ef16cf7f1ce74119c43.tar.gz
Make unlink with implicit $_ work once more
I broke this with commit ea5703f4. unlink is the only op that has the OA_DEFGV flag and no scalar or file arguments. Commit ea5703f4 changed the OA_DEFGV logic in ck_fun to generate a new $_ op for the first optional parameter, instead of just the first parameter, to avoid special-casing unpack. But lists are not marked with OA_OPTIONAL. So this commit changes it to check for list parame- ters as well.
Diffstat (limited to 'op.c')
-rw-r--r--op.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/op.c b/op.c
index b9f41f244e..01211e6fcf 100644
--- a/op.c
+++ b/op.c
@@ -7682,7 +7682,7 @@ Perl_ck_fun(pTHX_ OP *o)
}
while (oa) {
- if (oa & OA_OPTIONAL) {
+ if (oa & OA_OPTIONAL || (oa & 7) == OA_LIST) {
if (!kid && !seen_optional && PL_opargs[type] & OA_DEFGV)
*tokid = kid = newDEFSVOP();
seen_optional = TRUE;