This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
change#4866 was flawed; revert and add better fix for warning
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 23 Jan 2000 21:19:31 +0000 (21:19 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 23 Jan 2000 21:19:31 +0000 (21:19 +0000)
p4raw-link: @4866 on //depot/perl: ef8040b067557994d471dfa4e5ac3900907e94ce

p4raw-id: //depot/perl@4867

op.c
op.h

diff --git a/op.c b/op.c
index 29f860c..76e6b4d 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1098,7 +1098,7 @@ Perl_scalarvoid(pTHX_ OP *o)
     case OP_GGRGID:
     case OP_GETLOGIN:
       func_ops:
-       if (!(o->op_private & OPpLVAL_INTRO))
+       if (!(o->op_private & (OPpLVAL_INTRO|OPpOUR_INTRO)))
            useless = PL_op_desc[o->op_type];
        break;
 
@@ -6292,17 +6292,10 @@ Perl_peep(pTHX_ register OP *o)
 
        case OP_GV:
            if (o->op_next->op_type == OP_RV2SV) {
-               /* don't execute our($foo) */
-               if (o->op_next->op_private & OPpOUR_INTRO) {
+               if (!(o->op_next->op_private & OPpDEREF)) {
                    null(o->op_next);
-                   o->op_next = o->op_next->op_next;
-                   null(o);
-                   if (oldop && o->op_next)
-                       oldop->op_next = o->op_next;
-               }
-               else if (!(o->op_next->op_private & OPpDEREF)) {
-                   null(o->op_next);
-                   o->op_private |= o->op_next->op_private & OPpLVAL_INTRO;
+                   o->op_private |= o->op_next->op_private & (OPpLVAL_INTRO
+                                                              | OPpOUR_INTRO);
                    o->op_next = o->op_next->op_next;
                    o->op_type = OP_GVSV;
                    o->op_ppaddr = PL_ppaddr[OP_GVSV];
diff --git a/op.h b/op.h
index ae37f03..91cdb6b 100644 (file)
--- a/op.h
+++ b/op.h
@@ -137,7 +137,7 @@ typedef U32 PADOFFSET;
 #define OPpEARLY_CV            32      /* foo() called before sub foo was parsed */
   /* OP_?ELEM only */
 #define OPpLVAL_DEFER          16      /* Defer creation of array/hash elem */
-  /* OP_RV2?V only */
+  /* OP_RV2?V, OP_GVSV only */
 #define OPpOUR_INTRO           16      /* Defer creation of array/hash elem */
   /* for OP_RV2?V, lower bits carry hints (currently only HINT_STRICT_REFS) */