diff options
author | David Mitchell <davem@iabyn.com> | 2013-06-18 12:29:16 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-07-28 10:33:35 +0100 |
commit | 2c75e3628bc433543b3e475c87a64fb9e8d79871 (patch) | |
tree | fe909b5748281c5d562108432d188797be4359de /pp_hot.c | |
parent | f8a6dd2e91670031e094529649fe2380f2ee6854 (diff) | |
download | perl-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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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); |