projects
/
p5sagit/p5-mst-13.2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Encode 1.76 Released
[p5sagit/p5-mst-13.2.git]
/
mg.c
diff --git
a/mg.c
b/mg.c
index
9e0b4fa
..
4432429
100644
(file)
--- a/
mg.c
+++ b/
mg.c
@@
-57,6
+57,11
@@
S_save_magic(pTHX_ I32 mgs_ix, SV *sv)
{
MGS* mgs;
assert(SvMAGICAL(sv));
+#ifdef PERL_COPY_ON_WRITE
+ /* Turning READONLY off for a copy-on-write scalar is a bad idea. */
+ if (SvIsCOW(sv))
+ sv_force_normal(sv);
+#endif
SAVEDESTRUCTOR_X(restore_magic, INT2PTR(void*, (IV)mgs_ix));