summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2013-06-18 12:29:16 +0100
committerDavid Mitchell <davem@iabyn.com>2013-07-28 10:33:35 +0100
commit2c75e3628bc433543b3e475c87a64fb9e8d79871 (patch)
treefe909b5748281c5d562108432d188797be4359de /pp_hot.c
parentf8a6dd2e91670031e094529649fe2380f2ee6854 (diff)
downloadperl-2c75e3628bc433543b3e475c87a64fb9e8d79871.tar.gz
make intuit_start() handle mixed utf8-ness
Fix a bug in intuit_start() that makes it fail when the utf8-ness of the string and pattern differ. This was mostly masked, since pp_match() skips calling intuit in this case (and has done since 2000, presumably as a workaround for this issue, and possibly for other issues since fixed). But pp_subst() didn't skip, so code like this would fail: $c = "\x{c0}"; utf8::upgrade($c); print "ok\n" if $c =~ s/\xC0{1,2}$/\xC0/i; Now that intuit is (hopefully) fixed, also remove the guard in pp_match().
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 07a78938c3..9994280624 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1432,8 +1432,7 @@ PP(pp_match)
if (update_minmatch++)
minmatch = had_zerolen;
}
- if (RX_EXTFLAGS(rx) & RXf_USE_INTUIT &&
- DO_UTF8(TARG) == (RX_UTF8(rx) != 0)) {
+ if (RX_EXTFLAGS(rx) & RXf_USE_INTUIT) {
s = CALLREG_INTUIT_START(rx, TARG, truebase,
(char *)s, (char *)strend, r_flags, NULL);