diff options
author | David Mitchell <davem@iabyn.com> | 2011-02-17 14:13:04 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-02-18 11:25:24 +0000 |
commit | 0ab462a656aa799cb05352f5ff7596c9bf6893ee (patch) | |
tree | ff388483243d1e27099483c3045e30adf6f2a3ff /pp_hot.c | |
parent | 798bda5901ecadfc40314834ece57421e2c50146 (diff) | |
download | perl-0ab462a656aa799cb05352f5ff7596c9bf6893ee.tar.gz |
tweak the new pattern taint description
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -2059,18 +2059,19 @@ PP(pp_iter) /* A description of how taint works in pattern matching and substitution. -While the pattern is being assembled and them compiled, PL_tainted will -get set if any part of the pattern is tainted, e.g. qr/.*$tainted/. -At the end of pattern compilation, the RXf_TAINTED flag is set on the -pattern if PL_tainted is set. +While the pattern is being assembled/concatenated and them compiled, +PL_tainted will get set if any component of the pattern is tainted, e.g. +/.*$tainted/. At the end of pattern compilation, the RXf_TAINTED flag +is set on the pattern if PL_tainted is set. -When the pattern is copied, e.g. $r = qr/..../, the SV holding the ref the -pattern is marked as tainted. This means that subsequent usage, such as -/x$r/, will set PL_tainted and thus RXf_TAINTED on the new pattern too. +When the pattern is copied, e.g. $r = qr/..../, the SV holding the ref to +the pattern is marked as tainted. This means that subsequent usage, such +as /x$r/, will set PL_tainted, 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. +RXf_TAINTED_SEEN on the pattern if RF_tainted got set, or clears it +otherwise. In addition, 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. @@ -2115,8 +2116,8 @@ The overall action of pp_subst is: * Whenever control is being returned to perl code (either by falling off the "end" of pp_subst/pp_substcont, or by entering a /e block), use the flag bits in rxtainted to make all the appropriate types of - destination taint visible; e.g. set RXf_TAINTED_SEEN so that $1 et - al will appear tainted. + destination taint visible; e.g. set RXf_TAINTED_SEEN so that $1 + et al will appear tainted. pp_match is just a simpler version of the above. |