diff options
author | Tony Cook <tony@develop-help.com> | 2015-02-26 11:21:16 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-02-26 11:21:16 +1100 |
commit | ed38223246c041b4e9ce5687cadf6f6b903050ca (patch) | |
tree | ba8699c69934cb733ca509740eb98775652334c2 /inline.h | |
parent | e11fa374c86b187ae1e8382680d49e2e44abf1bb (diff) | |
download | perl-ed38223246c041b4e9ce5687cadf6f6b903050ca.tar.gz |
[perl #123202] speed up scalar //g against tainted strings
Diffstat (limited to 'inline.h')
-rw-r--r-- | inline.h | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -378,6 +378,30 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp) } /* + +Return false if any get magic is on the SV other than taint magic. + +*/ + +PERL_STATIC_INLINE bool +S_sv_only_taint_gmagic(SV *sv) { + MAGIC *mg = SvMAGIC(sv); + + PERL_ARGS_ASSERT_SV_ONLY_TAINT_GMAGIC; + + while (mg) { + if (mg->mg_type != PERL_MAGIC_taint + && !(mg->mg_flags & MGf_GSKIP) + && mg->mg_virtual->svt_get) { + return FALSE; + } + mg = mg->mg_moremagic; + } + + return TRUE; +} + +/* * Local variables: * c-indentation-style: bsd * c-basic-offset: 4 |