rpeep(): use OPpPADHV_ISKEYS, not OPpRV2HV_ISKEYS
authorDavid Mitchell <davem@iabyn.com>
Wed, 29 Nov 2017 08:16:26 +0000 (08:16 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 29 Nov 2017 08:16:26 +0000 (08:16 +0000)
I added a bit of code with 748f2c65599 that looked like:

    o->op_private |= (o->op_type == OP_PADHV ?
                      OPpRV2HV_ISKEYS : OPpRV2HV_ISKEYS);

That first constant should of course been OPpPADHV_ISKEYS - although
since both constants currently have the same value, it didn't make any
difference at the time.

Spotted by Coverity, and brought to my attention by jhi++.

op.c

diff --git a/op.c b/op.c
index 8e69409..7e7727a 100644 (file)
--- a/op.c
+++ b/op.c
@@ -15550,7 +15550,7 @@ Perl_rpeep(pTHX_ OP *o)
                     o->op_flags   &= ~(OPf_REF|OPf_WANT);
                     o->op_flags   |= want;
                     o->op_private |= (o->op_type == OP_PADHV ?
-                                      OPpRV2HV_ISKEYS : OPpRV2HV_ISKEYS);
+                                      OPpPADHV_ISKEYS : OPpRV2HV_ISKEYS);
                     /* for keys(%lex), hold onto the OP_KEYS's targ
                      * since padhv doesn't have its own targ to return
                      * an int with */