summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-07-26 10:52:48 +0200
committerRafael Garcia-Suarez <rgs@consttype.org>2010-07-26 10:52:48 +0200
commitf71f472facac5b530b24a8ff8a79a629776411e0 (patch)
tree84fec754d1794c9189e66e4fa5d19c56d0fc92af /pp_hot.c
parent0fe688f528b0e1b5bef6fb30d5e45316430e8a41 (diff)
downloadperl-f71f472facac5b530b24a8ff8a79a629776411e0.tar.gz
[perl #75656] lvalue subs don't copy on write
The attached patch teaches pp_leavesublv about kine. For the record, a binary search points its digit at: From: Nicholas Clark <nick@ccl4.org> Date: Mon, 6 Jun 2005 09:08:45 +0000 (+0000) Subject: Shared hash key scalars can be safely copied as shared hash key scalars Shared hash key scalars can be safely copied as shared hash key scalars all the time.
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 bd0f909025..d66dddee14 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2611,7 +2611,10 @@ PP(pp_leavesublv)
if (MARK == SP) {
/* Temporaries are bad unless they happen to be elements
* of a tied hash or array */
- if (SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY) &&
+ if ((SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP) ||
+ (SvFLAGS(TOPs) & (SVf_READONLY | SVf_FAKE))
+ == SVf_READONLY
+ ) &&
!(SvRMAGICAL(TOPs) && mg_find(TOPs, PERL_MAGIC_tiedelem))) {
LEAVE;
cxstack_ix--;