From 272d35c920ff70f3a216eedf88a0152190a41867 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Tue, 25 Dec 2012 20:51:50 +0000 Subject: 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. --- regexp.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'regexp.h') 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)) -- cgit v1.2.1