diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-06-04 11:38:02 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-06-04 14:34:30 -0700 |
commit | a130272381198bb249482fb77a994df28ddaf3bf (patch) | |
tree | e92e410cfe23ab013f2ee23aae51110e4936988c /pp_hot.c | |
parent | a8c75f4be1d24785526e639ef648a2b7906a61cc (diff) | |
download | perl-a130272381198bb249482fb77a994df28ddaf3bf.tar.gz |
Allow lvalue subs to return COWs in reference context
(That’s ‘reference’ as in ‘pass by reference’. It applies to
foo(lvalue_func()) and for(lvalue_func()).)
Commit f71f472 took care of scalar context.
Commit a0aa607 came and long and took care of list context, but,
unfortunately, missed reference context.
This commit takes care of that.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2697,7 +2697,9 @@ PP(pp_leavesublv) for (mark = newsp + 1; mark <= SP; mark++) { if (SvTEMP(*mark)) NOOP; - else if (SvFLAGS(*mark) & (SVs_PADTMP | SVf_READONLY)) + else if (SvFLAGS(*mark) & SVs_PADTMP + || (SvFLAGS(*mark) & (SVf_READONLY|SVf_FAKE)) + == SVf_READONLY) *mark = sv_mortalcopy(*mark); else { /* Can be a localized value subject to deletion. */ |