From: Nicholas Clark Date: Sat, 22 Nov 2003 21:21:22 +0000 (+0000) Subject: restore_magic needs to undo COW X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f97011767e2b1f2e51edcb85858dc587e7499126;p=p5sagit%2Fp5-mst-13.2.git restore_magic needs to undo COW (while magic was off, sv_setsv is likely to have seen this SV as a good source for COW) Should fix the smoke failures on lib/locale.t p4raw-id: //depot/perl@21774 --- diff --git a/mg.c b/mg.c index 494a4e2..92aa03f 100644 --- a/mg.c +++ b/mg.c @@ -2583,6 +2583,13 @@ restore_magic(pTHX_ void *p) if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv)) { +#ifdef PERL_COPY_ON_WRITE + /* While magic was saved (and off) sv_setsv may well have seen + this SV as a prime candidate for COW. */ + if (SvIsCOW(sv)) + sv_force_normal(sv); +#endif + if (mgs->mgs_flags) SvFLAGS(sv) |= mgs->mgs_flags; else