In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/05a206c836e4d4e324996ada45136cc40a68126c?hp=e759bc314f0fb0eebf211ca20ce3b52cbce6bd71>

- Log -----------------------------------------------------------------
commit 05a206c836e4d4e324996ada45136cc40a68126c
Author: Father Chrysostomos <[email protected]>
Date:   Sun Nov 25 17:13:21 2012 -0800

    Add Bob Ernst to AUTHORS

M       AUTHORS

commit 98c9650cd6a4e552074e5a73bc335c5d9f92ff52
Author: Father Chrysostomos <[email protected]>
Date:   Fri Oct 5 13:00:35 2012 -0700

    Move a CAN_COW_MASK comment from sv.c to sv.h
    
    It got left behind in ed25273444 when the macro moved.

M       sv.c
M       sv.h

commit 048a2f473ab9e1649559f56eff334b3c25289f57
Author: Father Chrysostomos <[email protected]>
Date:   Thu Oct 4 12:45:45 2012 -0700

    Missing dependency in XS::APItest’s Makefile
    
    When core_or_not.inc is modified, core.c and notcore.c should
    be recompiled.

M       ext/XS-APItest/Makefile.PL

commit 0f534aaf12174a6c02f455475bef3141f46c221b
Author: Father Chrysostomos <[email protected]>
Date:   Sun Nov 25 13:03:07 2012 -0800

    Stop cv-to-glob assignment redef warnings from leaking
    
    We should not increment the reference count of the assignee until we
    are past the warnings.  It should only happen when the reference-
    counted location is actually made to hold the assignee.
    
    At the same time, I changed it to use a more specific variant of
    SvREFCNT_inc, for speed.

M       sv.c
M       t/op/svleak.t
-----------------------------------------------------------------------

Summary of changes:
 AUTHORS                    |    1 +
 ext/XS-APItest/Makefile.PL |    2 ++
 sv.c                       |    6 ++----
 sv.h                       |    2 ++
 t/op/svleak.t              |    2 +-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 5e28ea5..70734b0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -136,6 +136,7 @@ Bo Borgerson                        <[email protected]>
 Bo Johansson                   <[email protected]>
 Bo Lindbergh                   <[email protected]>
 Bob Dalgleish                  <[email protected]>
+Bob Ernst                      <[email protected]>
 Bob Wilkinson                  <[email protected]>
 Boris Ratner                   <[email protected]>
 Boris Zentner                  <[email protected]>
diff --git a/ext/XS-APItest/Makefile.PL b/ext/XS-APItest/Makefile.PL
index 5e2955b..031ce8a 100644
--- a/ext/XS-APItest/Makefile.PL
+++ b/ext/XS-APItest/Makefile.PL
@@ -14,6 +14,8 @@ WriteMakefile(
     realclean => {FILES        => 'const-c.inc const-xs.inc'},
     ($Config{gccversion} && $Config{d_attribute_deprecated} ?
       (CCFLAGS => $Config{ccflags} . ' -Wno-deprecated-declarations') : ()),
+    depend => { 'core.o' => 'core_or_not.inc',
+               'notcore.o' => 'core_or_not.inc' },
 );
 
 my @names = (qw(HV_DELETE HV_DISABLE_UVAR_XKEY HV_FETCH_ISSTORE
diff --git a/sv.c b/sv.c
index a2d29ba..37344ae 100644
--- a/sv.c
+++ b/sv.c
@@ -66,8 +66,6 @@
 #ifdef PERL_OLD_COPY_ON_WRITE
 #define SV_COW_NEXT_SV(sv)     INT2PTR(SV *,SvUVX(sv))
 #define SV_COW_NEXT_SV_SET(current,next)       SvUV_set(current, PTR2UV(next))
-/* This is a pessimistic view. Scalar must be purely a read-write PV to copy-
-   on-write.  */
 #endif
 
 /* ============================================================================
@@ -3739,7 +3737,7 @@ S_glob_assign_glob(pTHX_ SV *const dstr, SV *const sstr, 
const int dtype)
 static void
 S_glob_assign_ref(pTHX_ SV *const dstr, SV *const sstr)
 {
-    SV * const sref = SvREFCNT_inc(SvRV(sstr));
+    SV * const sref = SvRV(sstr);
     SV *dref = NULL;
     const int intro = GvINTRO(dstr);
     SV **location;
@@ -3825,7 +3823,7 @@ S_glob_assign_ref(pTHX_ SV *const dstr, SV *const sstr)
            GvASSUMECV_on(dstr);
            if(GvSTASH(dstr)) mro_method_changed_in(GvSTASH(dstr)); /* sub foo 
{ 1 } sub bar { 2 } *bar = \&foo */
        }
-       *location = sref;
+       *location = SvREFCNT_inc_simple_NN(sref);
        if (import_flag && !(GvFLAGS(dstr) & import_flag)
            && CopSTASH_ne(PL_curcop, GvSTASH(dstr))) {
            GvFLAGS(dstr) |= import_flag;
diff --git a/sv.h b/sv.h
index e636eca..25ceff9 100644
--- a/sv.h
+++ b/sv.h
@@ -1844,6 +1844,8 @@ mg.c:1024: warning: left-hand operand of comma expression 
has no effect
 #  define SvRELEASE_IVX_(sv)  /**/
 #endif /* PERL_OLD_COPY_ON_WRITE */
 
+/* This is a pessimistic view. Scalar must be purely a read-write PV to copy-
+   on-write.  */
 #define CAN_COW_MASK   (SVs_OBJECT|SVs_GMG|SVs_SMG|SVs_RMG|SVf_IOK|SVf_NOK| \
                         SVf_POK|SVf_ROK|SVp_IOK|SVp_NOK|SVp_POK|SVf_FAKE| \
                         SVf_OOK|SVf_BREAK|SVf_READONLY)
diff --git a/t/op/svleak.t b/t/op/svleak.t
index e3f6be4..a3c14b8 100644
--- a/t/op/svleak.t
+++ b/t/op/svleak.t
@@ -87,11 +87,11 @@ eleak(2, 0, "no warnings; use feature ':all'; $all
              my sub foo{} sub foo:lvalue{}",
      'fatal mysub redef warning');
 eleak(2, 0, "$all sub foo{} sub foo{}", 'fatal sub redef warning');
-$::TODO = 'still leaks';
 eleak(2, 0, "$all *x=sub {}",
      'fatal sub redef warning with sub-to-glob assignment');
 eleak(2, 0, "$all *x=sub() {1}",
      'fatal const sub redef warning with sub-to-glob assignment');
+$::TODO = 'still leaks';
 eleak(2, 0, "$all XS::APItest::newCONSTSUB(\\%main::=>name=>0=>1)",
      'newXS sub redefinition with fatal warnings');
 eleak(2, 0, "$f 'misc'; my\$a,my\$a", 'double my with fatal warnings');

--
Perl5 Master Repository

Reply via email to