summaryrefslogtreecommitdiff
path: root/pp_hot.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_hot.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_hot.c')
-rw-r--r--pp_hot.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 2fba24a80e..8322e8936d 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -791,7 +791,7 @@ PP(pp_match)
DIE("panic: do_match");
TAINT_NOT;
- if (pm->op_pmflags & PMf_USED) {
+ if (pm->op_pmdynflags & PMdf_USED) {
failure:
if (gimme == G_ARRAY)
RETURN;
@@ -887,7 +887,7 @@ play_it_again:
{
curpm = pm;
if (pm->op_pmflags & PMf_ONCE)
- pm->op_pmflags |= PMf_USED;
+ pm->op_pmdynflags |= PMdf_USED;
goto gotcha;
}
else
@@ -952,7 +952,7 @@ yup: /* Confirmed by check_substr */
++BmUSEFUL(rx->check_substr);
curpm = pm;
if (pm->op_pmflags & PMf_ONCE)
- pm->op_pmflags |= PMf_USED;
+ pm->op_pmdynflags |= PMdf_USED;
Safefree(rx->subbase);
rx->subbase = Nullch;
if (global) {
@@ -1476,6 +1476,7 @@ PP(pp_subst)
s = SvPV(TARG, len);
if (!SvPOKp(TARG) || SvTYPE(TARG) == SVt_PVGV)
force_on_match = 1;
+ rxtainted = tainted << 1;
TAINT_NOT;
force_it:
@@ -1562,7 +1563,7 @@ PP(pp_subst)
curpm = pm;
SvSCREAM_off(TARG); /* disable possible screamer */
if (once) {
- rxtainted = RX_MATCH_TAINTED(rx);
+ rxtainted |= RX_MATCH_TAINTED(rx);
if (rx->subbase) {
m = orig + (rx->startp[0] - rx->subbase);
d = orig + (rx->endp[0] - rx->subbase);
@@ -1603,12 +1604,11 @@ PP(pp_subst)
else {
sv_chop(TARG, d);
}
- TAINT_IF(rxtainted);
+ TAINT_IF(rxtainted & 1);
SPAGAIN;
PUSHs(&sv_yes);
}
else {
- rxtainted = 0;
do {
if (iters++ > maxiters)
DIE("Substitution loop");
@@ -1632,11 +1632,12 @@ PP(pp_subst)
SvCUR_set(TARG, d - SvPVX(TARG) + i);
Move(s, d, i+1, char); /* include the NUL */
}
- TAINT_IF(rxtainted);
+ TAINT_IF(rxtainted & 1);
SPAGAIN;
PUSHs(sv_2mortal(newSViv((I32)iters)));
}
(void)SvPOK_only(TARG);
+ TAINT_IF(rxtainted);
if (SvSMAGICAL(TARG)) {
PUTBACK;
mg_set(TARG);
@@ -1653,7 +1654,7 @@ PP(pp_subst)
s = SvPV_force(TARG, len);
goto force_it;
}
- rxtainted = RX_MATCH_TAINTED(rx);
+ rxtainted |= RX_MATCH_TAINTED(rx);
dstr = NEWSV(25, len);
sv_setpvn(dstr, m, s-m);
curpm = pm;
@@ -1684,8 +1685,6 @@ PP(pp_subst)
} while (regexec_flags(rx, s, strend, orig, s == m, Nullsv, NULL, safebase));
sv_catpvn(dstr, s, strend - s);
- TAINT_IF(rxtainted);
-
(void)SvOOK_off(TARG);
Safefree(SvPVX(TARG));
SvPVX(TARG) = SvPVX(dstr);
@@ -1694,11 +1693,14 @@ PP(pp_subst)
SvPVX(dstr) = 0;
sv_free(dstr);
+ TAINT_IF(rxtainted & 1);
+ PUSHs(sv_2mortal(newSViv((I32)iters)));
+
(void)SvPOK_only(TARG);
+ TAINT_IF(rxtainted);
SvSETMAGIC(TARG);
SvTAINT(TARG);
SPAGAIN;
- PUSHs(sv_2mortal(newSViv((I32)iters)));
LEAVE_SCOPE(oldsave);
RETURN;
}