summaryrefslogtreecommitdiff
path: root/sv.h
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 /sv.h
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 'sv.h')
-rw-r--r--sv.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/sv.h b/sv.h
index e1797de7d4..313bfb8517 100644
--- a/sv.h
+++ b/sv.h
@@ -1473,10 +1473,9 @@ attention to precisely which outputs are influenced by which inputs.
#define SvTAINT(sv) \
STMT_START { \
- if (UNLIKELY(TAINTING_get)) { \
- if (UNLIKELY(TAINT_get)) \
- SvTAINTED_on(sv); \
- } \
+ assert(TAINTING_get || !TAINT_get); \
+ if (UNLIKELY(TAINT_get)) \
+ SvTAINTED_on(sv); \
} STMT_END
/*