summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 9c4120a3a7..0ca5f2b29c 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -129,7 +129,7 @@ PP(pp_regcomp)
some day. */
if (pm->op_type == OP_MATCH) {
SV *lhs;
- const bool was_tainted = PL_tainted;
+ const bool was_tainted = TAINT_get;
if (pm->op_flags & OPf_STACKED)
lhs = args[-1];
else if (pm->op_private & OPpTARGET_MY)
@@ -138,8 +138,8 @@ PP(pp_regcomp)
SvGETMAGIC(lhs);
/* Restore the previous value of PL_tainted (which may have been
modified by get-magic), to avoid incorrectly setting the
- RXf_TAINTED flag further down. */
- PL_tainted = was_tainted;
+ RXf_TAINTED flag with RX_TAINT_on further down. */
+ TAINT_set(was_tainted);
}
tmp = reg_temp_copy(NULL, new_re);
ReREFCNT_dec(new_re);
@@ -151,9 +151,9 @@ PP(pp_regcomp)
}
#ifndef INCOMPLETE_TAINTS
- if (PL_tainting && PL_tainted) {
+ if (TAINTING_get && TAINT_get) {
SvTAINTED_on((SV*)new_re);
- RX_EXTFLAGS(new_re) |= RXf_TAINTED;
+ RX_TAINT_on(new_re);
}
#endif
@@ -259,7 +259,7 @@ PP(pp_substcont)
/* update the taint state of various various variables in
* preparation for final exit.
* See "how taint works" above pp_subst() */
- if (PL_tainting) {
+ if (TAINTING_get) {
if ((cx->sb_rxtainted & SUBST_TAINT_PAT) ||
((cx->sb_rxtainted & (SUBST_TAINT_STR|SUBST_TAINT_RETAINT))
== (SUBST_TAINT_STR|SUBST_TAINT_RETAINT))
@@ -271,8 +271,10 @@ PP(pp_substcont)
)
SvTAINTED_on(TOPs); /* taint return value */
/* needed for mg_set below */
- PL_tainted = cBOOL(cx->sb_rxtainted &
- (SUBST_TAINT_STR|SUBST_TAINT_PAT|SUBST_TAINT_REPL));
+ TAINT_set(
+ cBOOL(cx->sb_rxtainted &
+ (SUBST_TAINT_STR|SUBST_TAINT_PAT|SUBST_TAINT_REPL))
+ );
SvTAINT(TARG);
}
/* PL_tainted must be correctly set for this mg_set */
@@ -321,7 +323,7 @@ PP(pp_substcont)
/* update the taint state of various various variables in preparation
* for calling the code block.
* See "how taint works" above pp_subst() */
- if (PL_tainting) {
+ if (TAINTING_get) {
if (RX_MATCH_TAINTED(rx)) /* run time pattern taint, eg locale */
cx->sb_rxtainted |= SUBST_TAINT_PAT;