This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: isASCII doesn't match outside ANYOF bitmap
authorKarl Williamson <public@khwilliamson.com>
Tue, 7 Dec 2010 21:50:13 +0000 (14:50 -0700)
committerKarl Williamson <public@khwilliamson.com>
Sat, 11 Dec 2010 22:57:31 +0000 (15:57 -0700)
So there is no need to tell regexec that it does, and then can combine
two other statements

regcomp.c

index cca4a4d..d493b5b 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -8677,7 +8677,8 @@ parseit:
                               S_set_regclass_bit(aTHX_ pRExC_state, ret, ASCII_TO_NATIVE(value));
                    }
                    yesno = '+';
-                   what = "ASCII";
+                   what = NULL;        /* Doesn't match outside ascii, so
+                                          don't want to add +utf8:: */
                    break;
                case ANYOF_NASCII:
                    if (LOC)
@@ -8727,12 +8728,9 @@ parseit:
                if (what) {
                    /* Strings such as "+utf8::isWord\n" */
                    Perl_sv_catpvf(aTHX_ listsv, "%cutf8::Is%s\n", yesno, what);
-               }
-
-               /* All but ASCII can match characters storable only in utf8 */
-               if (namedclass != ANYOF_ASCII) {
                    ANYOF_FLAGS(ret) |= ANYOF_UTF8;
                }
+
                continue;
            }
        } /* end of namedclass \blah */