summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-10-30 13:44:11 +0000
committerDavid Mitchell <davem@iabyn.com>2015-11-10 13:52:33 +0000
commitd48c660dfce02fc4e698f3b0589c77612ecf27a4 (patch)
tree0123423531b3d781e9606e4f3cbc6d3530b970b6 /pp_ctl.c
parentfc9a9443cb9edf6f5607176e09aebe85d00da5fe (diff)
downloadperl-d48c660dfce02fc4e698f3b0589c77612ecf27a4.tar.gz
avoid (TAINTING_get && TAINT_get)
In various places we test for both (PL_tainting && PL_tainted). Since if tainting isn't enabled PL_tainted should never get set, it's more efficient to just test for (TAINT_get). We ensure that PL_tainted doesn't actually get set when !PL_tainting by changing some "setting" macros from PL_tainted = TRUE to PL_tainted = PL_tainting.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index f9306e1d0a..c006ce9a22 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -165,7 +165,8 @@ PP(pp_regcomp)
}
- if (TAINTING_get && TAINT_get) {
+ assert(TAINTING_get || !TAINT_get);
+ if (TAINT_get) {
SvTAINTED_on((SV*)new_re);
RX_TAINT_on(new_re);
}