Change 31204 by [EMAIL PROTECTED] on 2007/05/12 22:40:05 Disable operator target setting for 'my' variables (OPpTARGET_MY) when madskills is active. Remove the p55 code required for dealing with the optimized tree. Subject: [PATCH] disable operator with target my when madskills enabled From: Gerard Goossen <[EMAIL PROTECTED]> Date: Thu Apr 19 15:31:27 2007 +0200 Message-Id: <[EMAIL PROTECTED]> also: Remove the just remove madprop 'M' doc Message-ID: <[EMAIL PROTECTED]>
Affected files ... ... //depot/perl/mad/Nomad.pm#3 edit ... //depot/perl/op.c#938 edit ... //depot/perl/op.h#179 edit Differences ... ==== //depot/perl/mad/Nomad.pm#3 (xtext) ==== Index: perl/mad/Nomad.pm --- perl/mad/Nomad.pm#2~30768~ 2007-03-26 14:48:48.000000000 -0700 +++ perl/mad/Nomad.pm 2007-05-12 15:40:05.000000000 -0700 @@ -598,7 +598,6 @@ my @retval; my @newkids; - push @retval, $self->madness('M ox'); for my $kid (@{$$self{Kids}}) { push @newkids, $kid->ast($self, @_); } @@ -615,7 +614,7 @@ sub ast { my $self = shift; - my @newkids = $self->madness('d M ox o ('); + my @newkids = $self->madness('d o ('); if (exists $$self{Kids}) { my $arg = $$self{Kids}[0]; @@ -632,8 +631,6 @@ my $self = shift; my @newkids; - push @newkids, $self->madness('M ox'); - my $left = $$self{Kids}[0]; push @newkids, $left->ast($self, @_); @@ -675,13 +672,9 @@ my $self = shift; my @retval; - my @before; my @after; - if (@before = $self->madness('M')) { - push @before, $self->madness('ox'); # o is the function name - } if (@retval = $self->madness('X')) { - push @before, $self->madness('o x'); + my @before, $self->madness('o x'); return P5AST::listop->new(Kids => [EMAIL PROTECTED],@retval]); } @@ -703,7 +696,7 @@ push @retval, @newkids; push @retval, $self->madness('} ] )'); - return $self->newtype->new(Kids => [EMAIL PROTECTED],@retval,@after]); + return $self->newtype->new(Kids => [EMAIL PROTECTED],@after]); } package PLXML::logop; @@ -1858,10 +1851,6 @@ my $self = shift; my @newkids; - my @before; - if (@before = $self->madness('M')) { - push @before, $self->madness('ox'); # o is the . - } my @after; my $left = $$self{Kids}[0]; push @newkids, $left->ast($self, @_); @@ -1878,10 +1867,6 @@ my $parent = $_[0]; my @newkids; - my @before; - if (@before = $self->madness('M')) { - push @before, $self->madness('ox'); # o is the . - } my @after; my $left = $$self{Kids}[0]; push @newkids, $left->ast($self, @_); @@ -1891,7 +1876,7 @@ my $right = $$self{Kids}[1]; push @newkids, $right->ast($self, @_); - return $self->newtype->new(Kids => [EMAIL PROTECTED], @newkids, @after]); + return $self->newtype->new(Kids => [EMAIL PROTECTED], @after]); } package PLXML::op_stringify; ==== //depot/perl/op.c#938 (text) ==== Index: perl/op.c --- perl/op.c#937~31203~ 2007-05-12 15:17:40.000000000 -0700 +++ perl/op.c 2007-05-12 15:40:05.000000000 -0700 @@ -6975,7 +6975,10 @@ if ((PL_opargs[kid->op_type] & OA_TARGLEX) && !(kid->op_flags & OPf_STACKED) /* Cannot steal the second time! */ - && !(kid->op_private & OPpTARGET_MY)) + && !(kid->op_private & OPpTARGET_MY) + /* Keep the full thing for madskills */ + && !PL_madskills + ) { OP * const kkid = kid->op_sibling; @@ -6988,13 +6991,8 @@ /* Now we do not need PADSV and SASSIGN. */ kid->op_sibling = o->op_sibling; /* NULL */ cLISTOPo->op_first = NULL; -#ifdef PERL_MAD - op_getmad(o,kid,'O'); - op_getmad(kkid,kid,'M'); -#else op_free(o); op_free(kkid); -#endif kid->op_private |= OPpTARGET_MY; /* Used for context settings */ return kid; } ==== //depot/perl/op.h#179 (text) ==== Index: perl/op.h --- perl/op.h#178~31049~ 2007-04-24 03:31:28.000000000 -0700 +++ perl/op.h 2007-05-12 15:40:05.000000000 -0700 @@ -700,7 +700,6 @@ * l last index of array ($#foo) * L label * m modifier on regex - * M my assignment slurped into some other operator's target * n sub or format name * o current operator/declarator name * o else/continue End of Patch.