This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
SvREFCNT_dec_NN in pp_require
authorDaniel Dragan <bulk88@hotmail.com>
Mon, 9 Jun 2014 09:50:19 +0000 (05:50 -0400)
committerTony Cook <tony@develop-help.com>
Thu, 12 Jun 2014 01:02:28 +0000 (11:02 +1000)
Some compilers (GCC) will inline+optimize this, some don't (Visual C). Make
it clear to not check for null twice.

pp_ctl.c

index 6a619ce..7f80ea4 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3962,11 +3962,11 @@ PP(pp_require)
                    filter_has_file = 0;
                    filter_cache = NULL;
                    if (filter_state) {
-                       SvREFCNT_dec(filter_state);
+                       SvREFCNT_dec_NN(filter_state);
                        filter_state = NULL;
                    }
                    if (filter_sub) {
-                       SvREFCNT_dec(filter_sub);
+                       SvREFCNT_dec_NN(filter_sub);
                        filter_sub = NULL;
                    }
                }