summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRadu Greab <radu@netsoft.ro>2001-07-05 01:13:31 +0300
committerJarkko Hietaniemi <jhi@iki.fi>2001-07-05 03:43:28 +0000
commit55d27857a33136b7f5f1ca74b1417d44e4f51b1c (patch)
tree542ac155fda0153c559c6e10968f799689161f94 /op.c
parentcf699fa3e207d56a23be5d1ac021e238471a28f1 (diff)
downloadperl-55d27857a33136b7f5f1ca74b1417d44e4f51b1c.tar.gz
(retracted by #13533)
Subject: [PATCH perl@11099]Re: [ID 20010704.003] Taint mode breaks global match Message-ID: <15171.27355.895094.128142@ix.netsoft.ro> p4raw-id: //depot/perl@11156
Diffstat (limited to 'op.c')
-rw-r--r--op.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/op.c b/op.c
index 2e6a13d02e..44c473954d 100644
--- a/op.c
+++ b/op.c
@@ -2035,9 +2035,15 @@ Perl_bind_match(pTHX_ I32 type, OP *left, OP *right)
right->op_type == OP_SUBST ||
right->op_type == OP_TRANS)) {
right->op_flags |= OPf_STACKED;
- if (right->op_type != OP_MATCH &&
- ! (right->op_type == OP_TRANS &&
- right->op_private & OPpTRANS_IDENTICAL))
+ if ((right->op_type != OP_MATCH &&
+ ! (right->op_type == OP_TRANS &&
+ right->op_private & OPpTRANS_IDENTICAL)) ||
+ /* if SV has magic, then match on original SV, not on its copy.
+ see note in pp_helem() */
+ (right->op_type == OP_MATCH &&
+ (left->op_type == OP_AELEM ||
+ left->op_type == OP_HELEM ||
+ left->op_type == OP_AELEMFAST)))
left = mod(left, right->op_type);
if (right->op_type == OP_TRANS)
o = newBINOP(OP_NULL, OPf_STACKED, scalar(left), right);