From 72ec8a821beca962b4748ef16cf7f1ce74119c43 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 21 Aug 2011 19:58:43 -0700 Subject: [PATCH] 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. --- op.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op.c b/op.c index b9f41f2..01211e6 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; -- 2.7.4