This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
SvREFCNT_dec_NN in SDBM
authorDaniel Dragan <bulk88@hotmail.com>
Fri, 12 Dec 2014 03:29:31 +0000 (22:29 -0500)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 12 Dec 2014 04:40:43 +0000 (20:40 -0800)
VC 2003 optimizer didn't catch it because SvREFCNT_dec is rarely inlined
on -O1

XSUB.h
ext/SDBM_File/SDBM_File.pm
ext/SDBM_File/SDBM_File.xs

diff --git a/XSUB.h b/XSUB.h
index 8e38df2..7b04281 100644 (file)
--- a/XSUB.h
+++ b/XSUB.h
@@ -414,7 +414,7 @@ Rethrows a previously caught exception.  See L<perlguts/"Exception Handling">.
                RETVAL = sv_mortalcopy(db_type) ;               \
            ST(0) = RETVAL ;                                    \
            if (db_type && (code == &PL_sv_undef)) {            \
-                SvREFCNT_dec(db_type) ;                                \
+               SvREFCNT_dec_NN(db_type) ;                      \
                db_type = NULL ;                                \
            }                                                   \
            else if (code) {                                    \
index 0410bef..f1f85f5 100644 (file)
@@ -7,7 +7,7 @@ require Tie::Hash;
 require XSLoader;
 
 our @ISA = qw(Tie::Hash);
-our $VERSION = "1.11";
+our $VERSION = "1.12";
 
 our @EXPORT_OK = qw(PAGFEXT DIRFEXT PAIRMAX);
 use Exporter "import";
index 070f074..bb994f7 100644 (file)
@@ -65,7 +65,7 @@ sdbm_DESTROY(db)
            sdbm_close(db->dbp);
            do {
                if (db->filter[i])
-                   SvREFCNT_dec(db->filter[i]);
+                   SvREFCNT_dec_NN(db->filter[i]);
            } while (i-- > 0);
            safefree(db) ;
        }