From: Nicholas Clark Date: Thu, 26 Jan 2006 14:57:42 +0000 (+0000) Subject: SvREADONLY_off inside the magic routines is also dangerous on shared X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d8b2590f979b3ba5689a5135513b1feda3473a5e;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/mg.c b/mg.c index a85cc46..1521241 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));