This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Stop setting OPf_REF on OP_ENTERSUB
authorFather Chrysostomos <sprout@cpan.org>
Mon, 5 Sep 2016 06:14:21 +0000 (23:14 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 5 Sep 2016 16:32:12 +0000 (09:32 -0700)
It isn’t doing anything really here, and I need it for
another purpose.

op.c

diff --git a/op.c b/op.c
index 30b5024..4c9ae50 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3272,7 +3272,8 @@ Perl_op_lvalue_flags(pTHX_ OP *o, I32 type, U32 flags)
         o->op_flags |= OPf_MOD;
 
     if (type == OP_AASSIGN || type == OP_SASSIGN)
-       o->op_flags |= OPf_SPECIAL|OPf_REF;
+       o->op_flags |= OPf_SPECIAL
+                     |(o->op_type == OP_ENTERSUB ? 0 : OPf_REF);
     else if (!type) { /* local() */
        switch (localize) {
        case 1:
@@ -3288,7 +3289,7 @@ Perl_op_lvalue_flags(pTHX_ OP *o, I32 type, U32 flags)
        }
     }
     else if (type != OP_GREPSTART && type != OP_ENTERSUB
-             && type != OP_LEAVESUBLV)
+             && type != OP_LEAVESUBLV && o->op_type != OP_ENTERSUB)
        o->op_flags |= OPf_REF;
     return o;
 }