[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-changes
Subject:    [perl.git]  branch smoke-me/bulk88/rt125296-wip-COPFILE-threads, updated. v5.23.8-22-g8cfa1d1
From:       Daniel Dragan <bulk88 () hotmail ! com>
Date:       2016-02-29 4:09:33
Message-ID: E1aaF9J-00044P-R5 () camel-001 ! ams6 ! corp ! booking ! com
[Download RAW message or body]

In perl.git, the branch smoke-me/bulk88/rt125296-wip-COPFILE-threads has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/8cfa1d1cae862358e259d1983bc0a12ecd185208?hp=31d0694c2f4e8d8895d8c70d4993d033634bdf0a>


- Log -----------------------------------------------------------------
commit 8cfa1d1cae862358e259d1983bc0a12ecd185208
Author: Daniel Dragan <bulk88@hotmail.com>
Date:   Sun Feb 28 23:08:47 2016 -0500

    pp_subst with -DPERL_NO_COW and s///r attempts to modify source SV
    
    pp_subst with a -DPERL_NO_COW build would die in
    ../dist/SelfLoader/t/03taint.t in this line
    "my $file = __FILE__ =~ s/[\w.]+\z/01SelfLoader.t/r;" with a attempt to
    modify since sv_force_normal_flags checks for readonlyness. The
    -DPERL_NO_COW exclusive logic seems faulty, since the COW branch right
    above stores the cow status and doesn't call sv_force_normal_flags until
    it actually wants to modify the source SV, and pp_subst wont modify the
    source SV if PMf_NONDESTRUCT is on. So fix the die by only de-COWing if
    !PMf_NONDESTRUCT. Do not deCOW the source SV if PMf_NONDESTRUCT.

M	pp_hot.c

commit cd38794d5d4345f5d0d78de7d6afad2869503c31
Author: Daniel Dragan <bulk88@hotmail.com>
Date:   Sun Feb 28 22:44:18 2016 -0500

    teach makedef.pl an alternate macro for PERL_COPY_ON_WRITE
    
    otherwise a -DPERL_NO_COW perl win32 build fails during linking perl523.dll
    with missing Perl_sv_setsv_cow

M	makedef.pl
-----------------------------------------------------------------------

Summary of changes:
 makedef.pl |  2 +-
 pp_hot.c   | 24 ++++++++++++++++--------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/makedef.pl b/makedef.pl
index a06a604..d727eb9 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -285,7 +285,7 @@ else {
 			 );
 }
 
-unless ($define{'PERL_COPY_ON_WRITE'}) {
+if (!$define{'PERL_COPY_ON_WRITE'} || $define{'PERL_NO_COW'}) {
     ++$skip{Perl_sv_setsv_cow};
 }
 
diff --git a/pp_hot.c b/pp_hot.c
index 6a280ab..d1efe74 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2915,15 +2915,23 @@ PP(pp_subst)
        because they make integers such as 256 "false".  */
     is_cow = SvIsCOW(TARG) ? TRUE : FALSE;
 #else
-    if (SvIsCOW(TARG))
-	sv_force_normal_flags(TARG,0);
+    if (!(rpm->op_pmflags & PMf_NONDESTRUCT)) {
+	if (SvIsCOW(TARG))
+	    sv_force_normal_flags(TARG,0);
+#endif
+#ifdef PERL_ANY_COW
+    if (!(rpm->op_pmflags & PMf_NONDESTRUCT) &&
+#else
+	if (
+#endif
+	    (SvREADONLY(TARG)
+		|| ( ((SvTYPE(TARG) == SVt_PVGV && isGV_with_GP(TARG))
+		      || SvTYPE(TARG) > SVt_PVLV)
+		     && !(SvTYPE(TARG) == SVt_PVGV && SvFAKE(TARG)))))
+	    Perl_croak_no_modify();
+#ifndef PERL_ANY_COW
+    }
 #endif
-    if (!(rpm->op_pmflags & PMf_NONDESTRUCT)
-	&& (SvREADONLY(TARG)
-	    || ( ((SvTYPE(TARG) == SVt_PVGV && isGV_with_GP(TARG))
-		  || SvTYPE(TARG) > SVt_PVLV)
-		 && !(SvTYPE(TARG) == SVt_PVGV && SvFAKE(TARG)))))
-	Perl_croak_no_modify();
     PUTBACK;
 
     orig = SvPV_nomg(TARG, len);

--
Perl5 Master Repository


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic