Skip to content

Commit c9e5693

Browse files
tonycozmauke
authored andcommitted
add tests for #21661
1 parent b163216 commit c9e5693

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

t/re/pat.t

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ skip_all_without_unicode_tables();
2828
my $has_locales = locales_enabled('LC_CTYPE');
2929
my $utf8_locale = find_utf8_ctype_locale();
3030

31-
plan tests => 1293; # Update this when adding/deleting tests.
31+
plan tests => 1295; # Update this when adding/deleting tests.
3232

3333
run_tests() unless caller;
3434

@@ -2627,6 +2627,22 @@ SKIP:
26272627

26282628
}
26292629

2630+
{
2631+
# github #21661
2632+
fresh_perl_is(<<'PROG', <<'EXPECT', {}, "double-free on fatal warn with existing error");
2633+
use warnings FATAL => qw(all);
2634+
/() {}/X;
2635+
PROG
2636+
Unknown regexp modifier "/X" at - line 2, at end of line
2637+
Unescaped left brace in regex is passed through in regex; marked by <-- HERE in m/() { <-- HERE }/ at - line 2.
2638+
Execution of - aborted due to compilation errors.
2639+
EXPECT
2640+
fresh_perl_is(<<'PROG', "", {}, "leak if __WARN__ handler dies");
2641+
use warnings;
2642+
local $SIG{__WARN__} = sub { die; };
2643+
eval "qr/()x{/;" for 1..10;
2644+
PROG
2645+
}
26302646
} # End of sub run_tests
26312647

26322648
1;

0 commit comments

Comments
 (0)