summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-12-25 20:51:50 +0000
committerDavid Mitchell <davem@iabyn.com>2012-12-25 20:51:50 +0000
commit272d35c920ff70f3a216eedf88a0152190a41867 (patch)
treec235dc93e1e57a46d3681b79b247d82038a2fffd /pp_hot.c
parent39819bd9daad8177c22032658cbd5c354aa2b92f (diff)
downloadperl-272d35c920ff70f3a216eedf88a0152190a41867.tar.gz
Eliminate RF_tainted flag from PL_reg_flags
This global flag is cleared at the start of execution, and then set if any locale-based nodes are executed. At the end of execution, the RXf_TAINTED_SEEN flag on the regex is set/cleared based on RF_tainted. We eliminate RF_tainted by simply directly setting RXf_TAINTED_SEEN each time a taintable node is executed. This is the final step before eliminating PL_reg_flags.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 33f8669e35..be634a30aa 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2084,12 +2084,11 @@ the pattern is marked as tainted. This means that subsequent usage, such
as /x$r/, will set PL_tainted using TAINT_set, and thus RXf_TAINTED,
on the new pattern too.
-During execution of a pattern, locale-variant ops such as ALNUML set the
-local flag RF_tainted. At the end of execution, the engine sets the
-RXf_TAINTED_SEEN on the pattern if RF_tainted got set, or clears it
-otherwise.
+At the start of execution of a pattern, the RXf_TAINTED_SEEN flag on the
+regex is cleared; during execution, locale-variant ops such as ALNUML may
+set RXf_TAINTED_SEEN.
-In addition, RXf_TAINTED_SEEN is used post-execution by the get magic code
+RXf_TAINTED_SEEN is used post-execution by the get magic code
of $1 et al to indicate whether the returned value should be tainted.
It is the responsibility of the caller of the pattern (i.e. pp_match,
pp_subst etc) to set this flag for any other circumstances where $1 needs