Skip to content

Commit

Permalink
add tests for #21661
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycoz committed Nov 29, 2023
1 parent 7e806ec commit 80c17cc
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion t/re/pat.t
Expand Up @@ -28,7 +28,7 @@ skip_all_without_unicode_tables();
my $has_locales = locales_enabled('LC_CTYPE');
my $utf8_locale = find_utf8_ctype_locale();

plan tests => 1265; # Update this when adding/deleting tests.
plan tests => 1267; # Update this when adding/deleting tests.

run_tests() unless caller;

Expand Down Expand Up @@ -2512,6 +2512,22 @@ SKIP:
ok($str =~ s/$copy/PQR/, 'replaced $copy with PQR');
is($str, "PQR", 'final string should be PQR');
}
{
# github #21661
fresh_perl_is(<<'PROG', <<'EXPECT', {}, "double-free on fatal warn with existing error");
use warnings FATAL => qw(all);
/() {}/X;
PROG
Unknown regexp modifier "/X" at - line 2, at end of line
Unescaped left brace in regex is passed through in regex; marked by <-- HERE in m/() { <-- HERE }/ at - line 2.
Execution of - aborted due to compilation errors.
EXPECT
fresh_perl_is(<<'PROG', "", {}, "leak if __WARN__ handler dies");
use warnings;
local $SIG{__WARN__} = sub { die; };
eval "qr/()x{/;" for 1..10;
PROG
}
} # End of sub run_tests

1;
Expand Down

0 comments on commit 80c17cc

Please sign in to comment.