diff options
author | Father Chrysostomos <sprout@cpan.org> | 2018-01-19 12:41:15 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2018-01-19 14:09:43 -0800 |
commit | bcfce88b64155612fcd6af40e88805fe32c25b7f (patch) | |
tree | d86c188bb617a76f629965d608be51e586936ba3 | |
parent | a8e51187c21fee8697b9299b5303d90883b1eba9 (diff) | |
download | perl-bcfce88b64155612fcd6af40e88805fe32c25b7f.tar.gz |
Apply the mod flag to @a in \(@a)
The next commit will depend on it.
-rw-r--r-- | op.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 |