summaryrefslogtreecommitdiff
path: root/mg.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2015-02-26 11:21:16 +1100
committerTony Cook <tony@develop-help.com>2015-02-26 11:21:16 +1100
commited38223246c041b4e9ce5687cadf6f6b903050ca (patch)
treeba8699c69934cb733ca509740eb98775652334c2 /mg.h
parente11fa374c86b187ae1e8382680d49e2e44abf1bb (diff)
downloadperl-ed38223246c041b4e9ce5687cadf6f6b903050ca.tar.gz
[perl #123202] speed up scalar //g against tainted strings
Diffstat (limited to 'mg.h')
-rw-r--r--mg.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/mg.h b/mg.h
index 3aa2401faa..becef4a787 100644
--- a/mg.h
+++ b/mg.h
@@ -65,7 +65,7 @@ struct magic {
/* assumes get-magic and stringification have already occurred */
# define MgBYTEPOS_set(mg,sv,pv,off) ( \
assert_((mg)->mg_type == PERL_MAGIC_regex_global) \
- SvPOK(sv) && !SvGMAGICAL(sv) \
+ SvPOK(sv) && (!SvGMAGICAL(sv) || sv_only_taint_gmagic(sv)) \
? (mg)->mg_len = (off), (mg)->mg_flags |= MGf_BYTES \
: ((mg)->mg_len = DO_UTF8(sv) \
? (SSize_t)utf8_length((U8 *)(pv), (U8 *)(pv)+(off)) \