diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-07-30 12:08:47 -0600 |
---|---|---|
committer | Florian Ragwitz <rafl@debian.org> | 2011-09-08 11:54:36 +0200 |
commit | 3feb3f49884efa2c4078dbbd3a4b68af4174b641 (patch) | |
tree | f4f407e118313464743bed39111d7fbb858aaf75 | |
parent | 6a24c9cef1fb5dac4c700f1de0db8e2c3f4f855e (diff) | |
download | perl-3feb3f49884efa2c4078dbbd3a4b68af4174b641.tar.gz |
Panic with \b and /aa
This was due to my oversight in not fixing this switch statement
to accommodate /aa when it was added.
-rw-r--r-- | pod/perldelta.pod | 6 | ||||
-rw-r--r-- | regexec.c | 1 | ||||
-rw-r--r-- | t/re/charset.t | 8 |
3 files changed, 12 insertions, 3 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 808c46d6b0..3780a5c233 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -202,6 +202,12 @@ copy-on-write values couldn't be deleted, nor could such hashes be cleared Locking a hash element that is a glob copy no longer causes subsequent assignment to it to corrupt the glob. +=item * + +A panic involving the combination of the regular expression modifiers +C</aa> introduced in 5.14.0 and the C<\b> escape sequence has been +fixed [perl #95964]. + =back =head1 Known Problems @@ -3710,6 +3710,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog) n = isALNUM(nextchr); break; case REGEX_ASCII_RESTRICTED_CHARSET: + case REGEX_ASCII_MORE_RESTRICTED_CHARSET: ln = isWORDCHAR_A(ln); n = isWORDCHAR_A(nextchr); break; diff --git a/t/re/charset.t b/t/re/charset.t index 4b64725276..e922686421 100644 --- a/t/re/charset.t +++ b/t/re/charset.t @@ -34,7 +34,7 @@ $testcases{'[:print:]'} = $testcases{'[:graph:]'}; $testcases{'[:space:]'} = $testcases{'\s'}; $testcases{'[:word:]'} = $testcases{'\w'}; -my @charsets = qw(a d u); +my @charsets = qw(a d u aa); if (! is_miniperl()) { require POSIX; my $current_locale = POSIX::setlocale( &POSIX::LC_ALL, "C") // ""; @@ -80,12 +80,14 @@ foreach my $charset (@charsets) { my $match = 1; # Calculated whether test regex should # match or not + local $::TODO = "/aa doesn't always work with utf8" if $upgrade && $charset eq "aa"; + # Everything always matches in ASCII, or under /u if ($ord < 128 || $charset eq 'u') { $reason = "\"$char\" is a $class under /$charset"; $neg_reason = "\"$char\" is not a $complement under /$charset"; } - elsif ($charset eq "a") { + elsif ($charset eq "a" || $charset eq "aa") { $match = 0; $reason = "\"$char\" is non-ASCII, which can't be a $class under /a"; $neg_reason = "\"$char\" is non-ASCII, which is a $complement under /a"; @@ -213,7 +215,7 @@ foreach my $charset (@charsets) { my $other_neg_reason = "\"$other\" is not a $complement under /$charset"; if ($other_ord > 127 && $charset ne 'u' - && ($charset eq "a" + && (($charset eq "a" || $charset eq "aa") || ($other_ord < 256 && ($charset eq 'l' || ! $upgrade)))) { $other_is_word = 0; |