summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-07-30 12:08:47 -0600
committerFlorian Ragwitz <rafl@debian.org>2011-09-08 11:54:36 +0200
commit3feb3f49884efa2c4078dbbd3a4b68af4174b641 (patch)
treef4f407e118313464743bed39111d7fbb858aaf75
parent6a24c9cef1fb5dac4c700f1de0db8e2c3f4f855e (diff)
downloadperl-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.pod6
-rw-r--r--regexec.c1
-rw-r--r--t/re/charset.t8
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
diff --git a/regexec.c b/regexec.c
index fd90ad7aa3..55bc045caa 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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;