This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
SvGROW should un-cow under PERL_OLD_COPY_ON_WRITE
authorFather Chrysostomos <sprout@cpan.org>
Thu, 2 Jan 2014 20:39:05 +0000 (12:39 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 17 Jan 2014 01:58:47 +0000 (17:58 -0800)
Otherwise pp_uc (and presumably other pieces of code) will end up mod-
ifying shared buffers.

Brought to you by PERL_DEBUG_READONLY_COW.

sv.h

diff --git a/sv.h b/sv.h
index e0e903c..42dfe6f 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -2138,7 +2138,7 @@ See also C<PL_sv_yes> and C<PL_sv_no>.
         == (SVt_PVLV|SVf_FAKE))
 
 
         == (SVt_PVLV|SVf_FAKE))
 
 
-#ifdef PERL_NEW_COPY_ON_WRITE
+#ifdef PERL_ANY_COW
 # define SvGROW(sv,len) \
        (SvIsCOW(sv) || SvLEN(sv) < (len) ? sv_grow(sv,len) : SvPVX(sv))
 #else
 # define SvGROW(sv,len) \
        (SvIsCOW(sv) || SvLEN(sv) < (len) ? sv_grow(sv,len) : SvPVX(sv))
 #else