diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-07-26 10:52:48 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-07-26 10:52:48 +0200 |
commit | f71f472facac5b530b24a8ff8a79a629776411e0 (patch) | |
tree | 84fec754d1794c9189e66e4fa5d19c56d0fc92af /pp_hot.c | |
parent | 0fe688f528b0e1b5bef6fb30d5e45316430e8a41 (diff) | |
download | perl-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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--; |