diff options
author | Eric Brine <ikegami@adaelis.com> | 2010-07-13 12:56:38 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-08-13 13:36:29 +0200 |
commit | 213f7ada530c1a4c4148622ba78577585f8ab9d0 (patch) | |
tree | 144b529bc5927bd2b3fe75be5791a6c6ed22fbaa /pp_hot.c | |
parent | e2fe06dd0f4d62a54d7bbc2a1f42dae0dd6bf19e (diff) | |
download | perl-213f7ada530c1a4c4148622ba78577585f8ab9d0.tar.gz |
Pure Perl lvalue subs can't return temps, even if they are magical. This holds back a fix for RT#67838.
This commit allows PP lvalue subs to return temps with set magic
and removes TODO from tests.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2610,13 +2610,13 @@ PP(pp_leavesublv) MARK = newsp + 1; EXTEND_MORTAL(1); if (MARK == SP) { - /* Temporaries are bad unless they happen to be elements - * of a tied hash or array */ + /* Temporaries are bad unless they happen to have set magic + * attached, such as the elements of a tied hash or array */ if ((SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP) || (SvFLAGS(TOPs) & (SVf_READONLY | SVf_FAKE)) == SVf_READONLY ) && - !(SvRMAGICAL(TOPs) && mg_find(TOPs, PERL_MAGIC_tiedelem))) { + !SvSMAGICAL(TOPs)) { LEAVE; cxstack_ix--; POPSUB(cx,sv); |