diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1999-09-05 02:07:42 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-09-06 18:06:06 +0000 |
commit | 3dbf192b2cd968c3b06108d76689ba36682d6f0e (patch) | |
tree | a483c9be28fc01e5d3f4b0311600b17c2cb36ec9 /op.c | |
parent | b78218b7f806d19fec2aa4d578cd6086927cd9ab (diff) | |
download | perl-3dbf192b2cd968c3b06108d76689ba36682d6f0e.tar.gz |
change#3612 is buggy when quotemeta argument matches target
(hope this is the last of the optimized-OP_SASSIGN bugs)
Message-Id: <199909051007.GAA06423@monk.mps.ohio-state.edu>
Subject: Re: [BUG: quotemeta]
p4raw-link: @3612 on //depot/perl: b162f9ead0a98db35cdcfc8c889e344c040c8d8e
p4raw-id: //depot/perl@4087
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -5381,14 +5381,13 @@ Perl_ck_sassign(pTHX_ OP *o) && !(kkid->op_private & OPpLVAL_INTRO)) { /* Concat has problems if target is equal to right arg. */ - if (kid->op_type == OP_CONCAT - && kLISTOP->op_first->op_sibling->op_type == OP_PADSV - && kLISTOP->op_first->op_sibling->op_targ == kkid->op_targ) - { - return o; + if (kid->op_type == OP_CONCAT) { + if (kLISTOP->op_first->op_sibling->op_type == OP_PADSV + && kLISTOP->op_first->op_sibling->op_targ == kkid->op_targ) + return o; } - if (kid->op_type == OP_JOIN) { - /* do_join has problems the arguments coincide with target. + else if (kid->op_type == OP_JOIN) { + /* do_join has problems if the arguments coincide with target. In fact the second argument *can* safely coincide, but ignore=pessimize this rare occasion. */ OP *arg = kLISTOP->op_first->op_sibling; /* Skip PUSHMARK */ @@ -5400,6 +5399,12 @@ Perl_ck_sassign(pTHX_ OP *o) arg = arg->op_sibling; } } + else if (kid->op_type == OP_QUOTEMETA) { + /* quotemeta has problems if the argument coincides with target. */ + if (kLISTOP->op_first->op_type == OP_PADSV + && kLISTOP->op_first->op_targ == kkid->op_targ) + return o; + } kid->op_targ = kkid->op_targ; /* Now we do not need PADSV and SASSIGN. */ kid->op_sibling = o->op_sibling; /* NULL */ |