summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-11-18 15:24:45 -0700
committerKarl Williamson <khw@cpan.org>2018-11-26 22:24:33 -0700
commit5b864157a512a368408bbffe50b594a639cba56a (patch)
tree5f51ed06c263acbe67cdc06655412c9cf388ead4
parent5bac62cf21849bc59401425b51eaffd56e878a6e (diff)
downloadperl-5b864157a512a368408bbffe50b594a639cba56a.tar.gz
regexec.c: Refactor expanded macro from prev. commit
-rw-r--r--regexec.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/regexec.c b/regexec.c
index 582b031064..32cea3fe33 100644
--- a/regexec.c
+++ b/regexec.c
@@ -6700,19 +6700,22 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
case ANYOF: /* /[abc]/ */
if (NEXTCHR_IS_EOS)
sayNO;
- if (utf8_target && ! UTF8_IS_INVARIANT(*locinput)) {
+ if ( (! utf8_target || UTF8_IS_INVARIANT(*locinput))
+ && ! ANYOF_FLAGS(scan))
+ {
+ if (! ANYOF_BITMAP_TEST(scan, * (U8 *) (locinput))) {
+ sayNO;
+ }
+ locinput++;
+ }
+ else {
if (!reginclass(rex, scan, (U8*)locinput, (U8*)reginfo->strend,
utf8_target))
+ {
sayNO;
- locinput += UTF8SKIP(locinput);
- }
- else {
- if (ANYOF_FLAGS(scan)
- ? ! reginclass(rex, scan, (U8*) locinput, (U8*) locinput+1, utf8_target)
- : ! ANYOF_BITMAP_TEST(scan, *(U8*) locinput))
- sayNO;
- locinput++;
- }
+ }
+ goto increment_locinput;
+ }
break;
case ANYOFM: