summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-15 01:34:53 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-15 01:34:53 +0000
commit8f0aad62d5e2da1c6a386df1876a37532c08865d (patch)
tree6e91e012efd9b99283cda0a0e070452f8d41eb8a /pp_ctl.c
parentdb74dc4280f7b61ec5cfcfaf87266ff2dae84bd1 (diff)
downloadperl-8f0aad62d5e2da1c6a386df1876a37532c08865d.tar.gz
[win32] merge change#905 from maintbranch, minor fixes to get
clean build+test on Solaris p4raw-link: @905 on //depot/maint-5.004/perl: 15e73149a8419f18d739227762eab108524cec56 p4raw-id: //depot/win32/perl@976
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 1ee85a6d87..75cf077b7b 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -130,8 +130,8 @@ PP(pp_substcont)
if (cx->sb_iters > cx->sb_maxiters)
DIE("Substitution loop");
- if (!cx->sb_rxtainted)
- cx->sb_rxtainted = SvTAINTED(TOPs);
+ if (!(cx->sb_rxtainted & 2) && SvTAINTED(TOPs))
+ cx->sb_rxtainted |= 2;
sv_catsv(dstr, POPs);
/* Are we done */
@@ -143,6 +143,7 @@ PP(pp_substcont)
sv_catpvn(dstr, s, cx->sb_strend - s);
TAINT_IF(cx->sb_rxtainted || RX_MATCH_TAINTED(rx));
+ cx->sb_rxtainted |= RX_MATCH_TAINTED(rx);
(void)SvOOK_off(targ);
Safefree(SvPVX(targ));
@@ -151,11 +152,15 @@ PP(pp_substcont)
SvLEN_set(targ, SvLEN(dstr));
SvPVX(dstr) = 0;
sv_free(dstr);
+
+ TAINT_IF(cx->sb_rxtainted & 1);
+ PUSHs(sv_2mortal(newSViv((I32)cx->sb_iters - 1)));
+
(void)SvPOK_only(targ);
+ TAINT_IF(cx->sb_rxtainted);
SvSETMAGIC(targ);
SvTAINT(targ);
- PUSHs(sv_2mortal(newSViv((I32)cx->sb_iters - 1)));
LEAVE_SCOPE(cx->sb_oldsave);
POPSUBST(cx);
RETURNOP(pm->op_next);