summaryrefslogtreecommitdiff
path: root/regexp.h
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 /regexp.h
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 'regexp.h')
-rw-r--r--regexp.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/regexp.h b/regexp.h
index 38633084b3..2c7eb87648 100644
--- a/regexp.h
+++ b/regexp.h
@@ -438,16 +438,22 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp)
#if NO_TAINT_SUPPORT
# define RX_ISTAINTED(prog) 0
# define RX_TAINT_on(prog) NOOP
+# define RXp_MATCH_TAINTED(prog) 0
+# define RX_MATCH_TAINTED(prog) 0
+# define RXp_MATCH_TAINTED_on(prog) NOOP
+# define RX_MATCH_TAINTED_on(prog) NOOP
+# define RX_MATCH_TAINTED_off(prog) NOOP
#else
# define RX_ISTAINTED(prog) (RX_EXTFLAGS(prog) & RXf_TAINTED)
# define RX_TAINT_on(prog) (RX_EXTFLAGS(prog) |= RXf_TAINTED)
+# define RXp_MATCH_TAINTED(prog) (RXp_EXTFLAGS(prog) & RXf_TAINTED_SEEN)
+# define RX_MATCH_TAINTED(prog) (RX_EXTFLAGS(prog) & RXf_TAINTED_SEEN)
+# define RXp_MATCH_TAINTED_on(prog) (RXp_EXTFLAGS(prog) |= RXf_TAINTED_SEEN)
+# define RX_MATCH_TAINTED_on(prog) (RX_EXTFLAGS(prog) |= RXf_TAINTED_SEEN)
+# define RX_MATCH_TAINTED_off(prog) (RX_EXTFLAGS(prog) &= ~RXf_TAINTED_SEEN)
#endif
#define RX_HAS_CUTGROUP(prog) ((prog)->intflags & PREGf_CUTGROUP_SEEN)
-#define RXp_MATCH_TAINTED(prog) (RXp_EXTFLAGS(prog) & RXf_TAINTED_SEEN)
-#define RX_MATCH_TAINTED(prog) (RX_EXTFLAGS(prog) & RXf_TAINTED_SEEN)
-#define RX_MATCH_TAINTED_on(prog) (RX_EXTFLAGS(prog) |= RXf_TAINTED_SEEN)
-#define RX_MATCH_TAINTED_off(prog) (RX_EXTFLAGS(prog) &= ~RXf_TAINTED_SEEN)
#define RX_MATCH_TAINTED_set(prog, t) ((t) \
? RX_MATCH_TAINTED_on(prog) \
: RX_MATCH_TAINTED_off(prog))