apply patch for smarter AASSIGN_COMMON detection; regen headers
authorStephen McCamant <smcc@mit.edu>
Sun, 12 Jul 1998 17:17:00 +0000 (12:17 -0500)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 12 Jul 1998 22:42:47 +0000 (22:42 +0000)
Message-Id: <13737.12300.950886.821143@alias-2.pr.mcs.net>
Subject: [PATCH] @a=@a=qw(1) not working, both 5.004_04 and 5.004_71

p4raw-id: //depot/perl@1458

op.c
opcode.h
opcode.pl

diff --git a/op.c b/op.c
index 89c70b4..58facaa 100644 (file)
--- a/op.c
+++ b/op.c
@@ -2223,6 +2223,8 @@ pmruntime(OP *o, OP *expr, OP *repl)
                             curop->op_type == OP_PADANY) {
                        repl_has_vars = 1;
                    }
+                   else if (curop->op_type == OP_PUSHRE)
+                       ; /* Okay here, dangerous in newASSIGNOP */
                    else
                        break;
                }
@@ -2522,6 +2524,14 @@ newASSIGNOP(I32 flags, OP *left, I32 optype, OP *right)
                        if (lastop->op_type != OP_GV)   /* funny deref? */
                            break;
                    }
+                   else if (curop->op_type == OP_PUSHRE) {
+                       if (((PMOP*)curop)->op_pmreplroot) {
+                           GV *gv = (GV*)((PMOP*)curop)->op_pmreplroot;
+                           if (gv == defgv || SvCUR(gv) == generation)
+                               break;
+                           SvCUR(gv) = generation;
+                       }       
+                   }
                    else
                        break;
                }
index a1e9174..04680c8 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -2180,7 +2180,7 @@ EXT U32 opargs[] = {
        0x00000040,     /* padav */
        0x00000040,     /* padhv */
        0x00000040,     /* padany */
-       0x00000600,     /* pushre */
+       0x00000640,     /* pushre */
        0x00000144,     /* rv2gv */
        0x00000144,     /* rv2sv */
        0x00000114,     /* av2arylen */
index f7e4f76..8544705 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -248,7 +248,7 @@ padav               private array           ck_null         d0
 padhv          private hash            ck_null         d0
 padany         private something       ck_null         d0
 
-pushre         push regexp             ck_null         /
+pushre         push regexp             ck_null         d/
 
 # References and stuff.