summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2010-11-14 10:37:41 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-11-22 13:32:53 -0800
commitef87b810d4ce2a22ca2d29a43907edb11b57b933 (patch)
tree3e01fa5fb0f8b85609d577fd3fdc6f55a3bd45fd /regexec.c
parent3e81b2d9f833beb8b7ae28a3f7a705f3232409bd (diff)
downloadperl-ef87b810d4ce2a22ca2d29a43907edb11b57b933.tar.gz
Split ANYOF_NONBITMAP into two components
ANYOF_NONBITMAP means that the node can match things that aren't in its bitmap. Some things can match only when the target string is in utf8, and some things can match even if it isn't. If the target string is not in utf8, and we know that the only possible match is when it is in utf8, we know it can't match, and avoid a fruitless, expensive swash load. This change also fixes a number of problems shown in t/re/grind_fold.t that I will deliver soon.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index b0e5777824..dcb83c2ca4 100644
--- a/regexec.c
+++ b/regexec.c
@@ -6299,11 +6299,13 @@ S_reginclass(pTHX_ const regexp * const prog, register const regnode * const n,
/* If the bitmap didn't (or couldn't) match, and something outside the
* bitmap could match, try that */
- if (!match && (utf8_target || (flags & ANYOF_NONBITMAP))) {
+ if (!match) {
if (utf8_target && (flags & ANYOF_UNICODE_ALL) && c >= 256) {
match = TRUE;
}
- else {
+ else if ((flags & ANYOF_NONBITMAP_NON_UTF8)
+ || (utf8_target && flags & ANYOF_UTF8))
+ {
AV *av;
SV * const sw = regclass_swash(prog, n, TRUE, 0, (SV**)&av);