summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-08-07 00:56:32 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-11 07:41:26 -0700
commit3805b5fb04f8819edfb6bd5256d5eefd7b23e730 (patch)
tree9e0f64fd00518bc7d03cd2d8c9cd72efe73cec40 /mg.c
parent0ffdaf1a47312f763d4610e9ec65c24561e957a5 (diff)
downloadperl-3805b5fb04f8819edfb6bd5256d5eefd7b23e730.tar.gz
Remove SvIsCOW checks from mg.c:S_save_magic
It no longer needs to worry about SvIsCOW. This logic is left over from when READONLY+FAKE was used for COWs. Since it is possible for COWs to be read-only now, this logic is actu- ally faulty, as it doesn’t temporarily stop read-only COWs from being read-only, as it does for other read-only values. This actually causes bugs with scalar-tied locked hash keys, which croak on FETCH.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mg.c b/mg.c
index a6f2c53bd3..d22f620c91 100644
--- a/mg.c
+++ b/mg.c
@@ -116,14 +116,12 @@ S_save_magic_flags(pTHX_ I32 mgs_ix, SV *sv, U32 flags)
mgs = SSPTR(mgs_ix, MGS*);
mgs->mgs_sv = sv;
mgs->mgs_magical = SvMAGICAL(sv);
- mgs->mgs_readonly = SvREADONLY(sv) && !SvIsCOW(sv);
+ mgs->mgs_readonly = SvREADONLY(sv);
mgs->mgs_ss_ix = PL_savestack_ix; /* points after the saved destructor */
mgs->mgs_bumped = bumped;
SvFLAGS(sv) &= ~flags;
- /* Turning READONLY off for a copy-on-write scalar (including shared
- hash keys) is a bad idea. */
- if (!SvIsCOW(sv)) SvREADONLY_off(sv);
+ SvREADONLY_off(sv);
}
#define save_magic(a,b) save_magic_flags(a,b,SVs_GMG|SVs_SMG|SVs_RMG)