summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-01-26 14:57:42 +0000
committerNicholas Clark <nick@ccl4.org>2006-01-26 14:57:42 +0000
commitd8b2590f979b3ba5689a5135513b1feda3473a5e (patch)
tree71b643d3e764f734898f443df9edddb7f2071dc7 /mg.c
parent5b047c536d1d4af9afcf38bdde386f229beb9493 (diff)
downloadperl-d8b2590f979b3ba5689a5135513b1feda3473a5e.tar.gz
SvREADONLY_off inside the magic routines is also dangerous on shared
hash key scalars, so decompose them to normal scalars if they ever get here. p4raw-id: //depot/perl@26946
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mg.c b/mg.c
index a85cc46394..1521241352 100644
--- a/mg.c
+++ b/mg.c
@@ -86,11 +86,10 @@ S_save_magic(pTHX_ I32 mgs_ix, SV *sv)
dVAR;
MGS* mgs;
assert(SvMAGICAL(sv));
-#ifdef PERL_OLD_COPY_ON_WRITE
- /* Turning READONLY off for a copy-on-write scalar is a bad idea. */
+ /* Turning READONLY off for a copy-on-write scalar (including shared
+ hash keys) is a bad idea. */
if (SvIsCOW(sv))
sv_force_normal_flags(sv, 0);
-#endif
SAVEDESTRUCTOR_X(S_restore_magic, INT2PTR(void*, (IV)mgs_ix));