This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl #110648, single Unicode prop in inverted class not getting inverted
authorKarl Williamson <public@khwilliamson.com>
Tue, 14 Feb 2012 19:04:21 +0000 (12:04 -0700)
committerKarl Williamson <public@khwilliamson.com>
Tue, 14 Feb 2012 19:25:46 +0000 (12:25 -0700)
Commit b6c46382308166d54090e3d8e385710664693ac0 introduced a bug when
an inverted bracketed character class consists solely of a Unicode
property, that property wasn't getting inverted outside the Latin1
range.

This was due to an optimization that should have been disabled for this
case.

pod/perldelta.pod
regcomp.c
t/re/re_tests

index 33b9af4..9920e1e 100644 (file)
@@ -717,6 +717,13 @@ C</[[:ascii:]]/> and C</[[:blank:]]/> now use locale rules under
 C<use locale> when the platform supports that.  Previously, they used
 the platform's native character set.
 
+=item *
+
+A regression introduced in 5.13.6 was fixed.  This involved an inverted
+bracketed character class in a regular expression that consisted solely
+of a Unicode property, that property wasn't getting inverted outside the
+Latin1 range.
+
 =back
 
 =head1 Known Problems
index b33edda..a996049 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -11425,6 +11425,12 @@ parseit:
             * there should not be overlap unless is /d rules. */
            _invlist_invert(nonbitmap);
 
+           /* Any swash can't be used as-is, because we've inverted things */
+           if (swash) {
+               SvREFCNT_dec(swash);
+               swash = NULL;
+           }
+
            for (i = 0; i < 256; ++i) {
                if (ANYOF_BITMAP_TEST(ret, i)) {
                    ANYOF_BITMAP_CLEAR(ret, i);
index 4eafaf7..e7680c9 100644 (file)
@@ -1572,4 +1572,7 @@ abc\N{def -       c       -       \\N{NAME} must be resolved by the lexer
 /[[:lower:]]/i \N{U+3400}      n       -       -
 /[[:upper:]]/i \N{U+01BB}      n       -       -
 
+# [perl #110648]
+[^\p{Alphabetic}]      \x{100} n       -       -
+
 # vim: softtabstop=0 noexpandtab