summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2018-01-19 12:41:15 -0800
committerFather Chrysostomos <sprout@cpan.org>2018-01-19 14:09:43 -0800
commitbcfce88b64155612fcd6af40e88805fe32c25b7f (patch)
treed86c188bb617a76f629965d608be51e586936ba3
parenta8e51187c21fee8697b9299b5303d90883b1eba9 (diff)
downloadperl-bcfce88b64155612fcd6af40e88805fe32c25b7f.tar.gz
Apply the mod flag to @a in \(@a)
The next commit will depend on it.
-rw-r--r--op.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/op.c b/op.c
index 2b87f9c781..373822a349 100644
--- a/op.c
+++ b/op.c
@@ -4081,7 +4081,10 @@ Perl_op_lvalue_flags(pTHX_ OP *o, I32 type, U32 flags)
case OP_RV2HV:
if (type == OP_REFGEN && o->op_flags & OPf_PARENS) {
PL_modcount = RETURN_UNLIMITED_NUMBER;
- return o; /* Treat \(@foo) like ordinary list. */
+ /* Treat \(@foo) like ordinary list, but still mark it as modi-
+ fiable since some contexts need to know. */
+ o->op_flags |= OPf_MOD;
+ return o;
}
/* FALLTHROUGH */
case OP_RV2GV:
@@ -4146,7 +4149,12 @@ Perl_op_lvalue_flags(pTHX_ OP *o, I32 type, U32 flags)
case OP_PADHV:
PL_modcount = RETURN_UNLIMITED_NUMBER;
if (type == OP_REFGEN && o->op_flags & OPf_PARENS)
- return o; /* Treat \(@foo) like ordinary list. */
+ {
+ /* Treat \(@foo) like ordinary list, but still mark it as modi-
+ fiable since some contexts need to know. */
+ o->op_flags |= OPf_MOD;
+ return o;
+ }
if (scalar_mod_type(o, type))
goto nomod;
if ((o->op_flags & OPf_WANT) != OPf_WANT_SCALAR