summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-09-05 02:07:42 -0400
committerGurusamy Sarathy <gsar@cpan.org>1999-09-06 18:06:06 +0000
commit3dbf192b2cd968c3b06108d76689ba36682d6f0e (patch)
treea483c9be28fc01e5d3f4b0311600b17c2cb36ec9 /op.c
parentb78218b7f806d19fec2aa4d578cd6086927cd9ab (diff)
downloadperl-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.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/op.c b/op.c
index 3f5541c650..babe0d7ea3 100644
--- a/op.c
+++ b/op.c
@@ -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 */