summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorTassilo von Parseval <tassilo.parseval@post.rwth-aachen.de>2005-07-20 12:43:11 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-07-20 09:08:56 +0000
commitf9bc45eff51a0e2fac1537ecee1124be910c832e (patch)
tree7de66ce3081a82e015c7583115e0bd924d5b67bc /pp_hot.c
parent37d19de818f4f6fae6d075d28278cad409bf2d33 (diff)
downloadperl-f9bc45eff51a0e2fac1537ecee1124be910c832e.tar.gz
lvalue-subs returning elements of tied hashes/arrays
Message-id: <20050720084311.GA20332@ethan> p4raw-id: //depot/perl@25194
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 1e3d5ead22..8298026457 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2441,7 +2441,10 @@ PP(pp_leavesublv)
MARK = newsp + 1;
EXTEND_MORTAL(1);
if (MARK == SP) {
- if (SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
+ /* Temporaries are bad unless they happen to be elements
+ * of a tied hash or array */
+ if (SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY) &&
+ !(SvRMAGICAL(TOPs) && mg_find(TOPs, PERL_MAGIC_tiedelem))) {
LEAVE;
cxstack_ix--;
POPSUB(cx,sv);