Skip to content

Commit 1f167b4

Browse files
committed
Move one test
1 parent 12fb0b9 commit 1f167b4

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

t/op/goto-amp-name.t

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use warnings;
1111
use strict;
1212
use Config;
1313
#plan tests => 'no_plan'; # yet
14-
plan tests => 11;
14+
plan tests => 12;
1515
our $TODO;
1616

1717
# Excerpts from 'perldoc -f goto' as of perl-5.40.1 (Aug 2025)
@@ -57,6 +57,16 @@ local $SIG{__WARN__} = sub {
5757

5858
our $foo;
5959

60+
# [perl #36521] goto &foo in warn handler could defeat recursion avoider
61+
62+
{
63+
my $r = runperl(
64+
stderr => 1,
65+
prog => 'my $d; my $w = sub { return if $d++; warn q(bar)}; local $SIG{__WARN__} = sub { goto &$w; }; warn q(foo);'
66+
);
67+
like($r, qr/bar/, "goto &foo in warn");
68+
}
69+
6070
# v5.31.3-198-gd2cd363728 broke this. goto &XS_sub wasn't restoring
6171
# cx->blk_sub.old_cxsubix. Would panic in pp_return
6272

t/op/goto.t

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use warnings;
1313
use strict;
1414
use Config;
1515
#plan tests => 134;
16-
plan tests => 124;
16+
plan tests => 123;
1717
our $TODO;
1818

1919
my $deprecated = 0;
@@ -597,16 +597,16 @@ sub {
597597
}->();
598598

599599

600-
# [perl #36521] goto &foo in warn handler could defeat recursion avoider
601-
602-
{
603-
my $r = runperl(
604-
stderr => 1,
605-
prog => 'my $d; my $w = sub { return if $d++; warn q(bar)}; local $SIG{__WARN__} = sub { goto &$w; }; warn q(foo);'
606-
);
607-
like($r, qr/bar/, "goto &foo in warn");
608-
}
609-
600+
## [perl #36521] goto &foo in warn handler could defeat recursion avoider
601+
#
602+
#{
603+
# my $r = runperl(
604+
# stderr => 1,
605+
# prog => 'my $d; my $w = sub { return if $d++; warn q(bar)}; local $SIG{__WARN__} = sub { goto &$w; }; warn q(foo);'
606+
# );
607+
# like($r, qr/bar/, "goto &foo in warn");
608+
#}
609+
#
610610
TODO: {
611611
local $TODO = "[perl #43403] goto() from an if to an else doesn't undo local () changes";
612612
our $global = "unmodified";

0 commit comments

Comments
 (0)