summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-07-05 21:00:31 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-07-05 21:00:31 +0000
commit461824dcfbc00b3c4e20590f06d6c9881e4a416b (patch)
tree3552f21bb4637618a680a0d04e52d6de39c5f43b /op.c
parentf17e6c41cacfbc6fe88a5ea5e01ba690dfdc7f2e (diff)
downloadperl-461824dcfbc00b3c4e20590f06d6c9881e4a416b.tar.gz
Implement handling of state variables in list assignment
p4raw-id: //depot/perl@28489
Diffstat (limited to 'op.c')
-rw-r--r--op.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/op.c b/op.c
index dd7a5f2dea..370a01fb59 100644
--- a/op.c
+++ b/op.c
@@ -3783,6 +3783,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
* to store these values, evil chicanery is done with SvCUR().
*/
+ {
OP *lastop = o;
PL_generation++;
for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) {
@@ -3799,6 +3800,11 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
curop->op_type == OP_PADHV ||
curop->op_type == OP_PADANY)
{
+ if ((left->op_private & OPpLVAL_INTRO) && (curop->op_private & OPpPAD_STATE)) {
+ o->op_private |= OPpASSIGN_STATE;
+ /* hijacking PADSTALE for uninitialized state variables */
+ SvPADSTALE_on(PAD_SVl(curop->op_targ));
+ }
if (PAD_COMPNAME_GEN(curop->op_targ)
== (STRLEN)PL_generation)
break;
@@ -3836,6 +3842,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
}
if (curop != o)
o->op_private |= OPpASSIGN_COMMON;
+ }
if (right && right->op_type == OP_SPLIT) {
OP* tmpop = ((LISTOP*)right)->op_first;
if (tmpop && (tmpop->op_type == OP_PUSHRE)) {