This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_newATTRSUB_x: cast a bool arg
authorDavid Mitchell <davem@iabyn.com>
Wed, 25 Nov 2015 15:58:20 +0000 (15:58 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 25 Nov 2015 15:58:20 +0000 (15:58 +0000)
S_op_const_sv() expects a bool arg, so cast accordingly.
(Otherwise if the flag bit is > bit 7, it could get truncated to 0)

op.c

diff --git a/op.c b/op.c
index f1d4027..168aef3 100644 (file)
--- a/op.c
+++ b/op.c
@@ -8398,7 +8398,8 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs,
        block->op_next = 0;
         if (ps && !*ps && !attrs && !CvLVALUE(PL_compcv))
             const_sv =
-                S_op_const_sv(aTHX_ start, PL_compcv, CvCLONE(PL_compcv));
+                S_op_const_sv(aTHX_ start, PL_compcv,
+                                        cBOOL(CvCLONE(PL_compcv)));
         else
             const_sv = NULL;
     }