summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorEric Brine <ikegami@adaelis.com>2010-07-13 12:56:38 -0700
committerRafael Garcia-Suarez <rgs@consttype.org>2010-08-13 13:36:29 +0200
commit213f7ada530c1a4c4148622ba78577585f8ab9d0 (patch)
tree144b529bc5927bd2b3fe75be5791a6c6ed22fbaa /pp_hot.c
parente2fe06dd0f4d62a54d7bbc2a1f42dae0dd6bf19e (diff)
downloadperl-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 2b67f4f23a..e1f0fc9904 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -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);