summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-14 13:02:48 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-14 13:10:58 -0800
commite3918bb703cafa92e5a8d957a810cafe3334d9a1 (patch)
tree0dc55cf37087f45a20d83132e32b1f5fb8feb14d /pp_sys.c
parente9cb264cbba0cfffe4b822389c0be43c54755b66 (diff)
downloadperl-e3918bb703cafa92e5a8d957a810cafe3334d9a1.tar.gz
SVf_IsCOW
As discussed in ticket #114820, instead of using READONLY+FAKE to mark a copy-on-write string, we should make it a separate flag. There are many modules in CPAN (and 1 in core, Compress::Raw::Zlib) that assume that SvREADONLY means read-only. Only one CPAN module, POSIX::pselect will definitely be broken by this. Others may need to be tweaked. But I believe this is for the better. It causes all tests except ext/Devel-Peek/t/Peek.t (which needs a tiny tweak still) to pass under PERL_OLD_COPY_ON_WRITE, which is a prereq- uisite for any new COW scheme that creates COWs under the same cir- cumstances.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 938aafe0f2..54fe66183a 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1096,12 +1096,10 @@ PP(pp_sselect)
SvGETMAGIC(sv);
if (!SvOK(sv))
continue;
- if (SvREADONLY(sv)) {
- if (SvIsCOW(sv))
+ if (SvIsCOW(sv))
sv_force_normal_flags(sv, 0);
- if (SvREADONLY(sv) && !(SvPOK(sv) && SvCUR(sv) == 0))
+ if (SvREADONLY(sv) && !(SvPOK(sv) && SvCUR(sv) == 0))
Perl_croak_no_modify();
- }
if (!SvPOK(sv)) {
if (!SvPOKp(sv))
Perl_ck_warner(aTHX_ packWARN(WARN_MISC),