This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix compiler warning in toke.c
authorDavid Mitchell <davem@iabyn.com>
Sat, 26 Mar 2011 16:31:49 +0000 (16:31 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 26 Mar 2011 16:50:08 +0000 (16:50 +0000)
The third arg to newSVOP must be non-null, and the macro expansion
for SvREFCNT_inc can give a null value sometimes. So replace it
with SvREFCNT_inc_NN and everyone's happy..

toke.c

diff --git a/toke.c b/toke.c
index 6933e62..9642ad3 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -6597,7 +6597,7 @@ Perl_yylex(pTHX)
                    goto safe_bareword;
 
                {
                    goto safe_bareword;
 
                {
-                   OP *const_op = newSVOP(OP_CONST, 0, SvREFCNT_inc(sv));
+                   OP *const_op = newSVOP(OP_CONST, 0, SvREFCNT_inc_NN(sv));
                    const_op->op_private = OPpCONST_BARE;
                    rv2cv_op = newCVREF(0, const_op);
                }
                    const_op->op_private = OPpCONST_BARE;
                    rv2cv_op = newCVREF(0, const_op);
                }