summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2016-10-04 14:40:11 +0100
committerHugo van der Sanden <hv@crypt.org>2016-10-04 15:02:36 +0100
commit2814f4b3549f665a6f9203ac9e890ae1e415e0dc (patch)
tree8587121c0636eef80c7c842eff140d9d266386a9 /regexec.c
parentdbdb57e61cddbe8e7a199ac438f0523d0c20e4ce (diff)
downloadperl-2814f4b3549f665a6f9203ac9e890ae1e415e0dc.tar.gz
[perl #129350] anchored/floating substrings must be utf8 if target is
If the target is utf8 and either the anchored or floating substrings are not, we need to create utf8 copies to check against. The state of the two substrings may not be the same, but we were only testing whichever we planned to check first.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index b86cb1b4d9..e9e23f2853 100644
--- a/regexec.c
+++ b/regexec.c
@@ -703,7 +703,8 @@ Perl_re_intuit_start(pTHX_
reginfo->poscache_maxiter = 0;
if (utf8_target) {
- if (!prog->check_utf8 && prog->check_substr)
+ if ((!prog->anchored_utf8 && prog->anchored_substr)
+ || (!prog->float_utf8 && prog->float_substr))
to_utf8_substr(prog);
check = prog->check_utf8;
} else {