summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen McCamant <smcc@mit.edu>1998-07-12 12:17:00 -0500
committerGurusamy Sarathy <gsar@cpan.org>1998-07-12 22:42:47 +0000
commit1167e5dafaeb6f2fafbecb2493434aa60f088f4d (patch)
tree203e5f4c186e964f3a0f41312770077047c4216d
parenta3f9223b8714edf9abd00efc3fc8a087202f1e98 (diff)
downloadperl-1167e5dafaeb6f2fafbecb2493434aa60f088f4d.tar.gz
apply patch for smarter AASSIGN_COMMON detection; regen headers
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
-rw-r--r--op.c10
-rw-r--r--opcode.h2
-rwxr-xr-xopcode.pl2
3 files changed, 12 insertions, 2 deletions
diff --git a/op.c b/op.c
index 89c70b4e9e..58facaae07 100644
--- 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;
}
diff --git a/opcode.h b/opcode.h
index a1e91748b3..04680c894f 100644
--- 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 */
diff --git a/opcode.pl b/opcode.pl
index f7e4f76eac..8544705b76 100755
--- 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.