File tree Expand file tree Collapse file tree 2 files changed +22
-12
lines changed
Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use warnings;
1111use strict;
1212use Config;
1313# plan tests => 'no_plan'; # yet
14- plan tests => 11 ;
14+ plan tests => 12 ;
1515our $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
5858our $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
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ use warnings;
1313use strict;
1414use Config;
1515# plan tests => 134;
16- plan tests => 124 ;
16+ plan tests => 123 ;
1717our $TODO ;
1818
1919my $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+ #
610610TODO: {
611611 local $TODO = " [perl #43403] goto() from an if to an else doesn't undo local () changes" ;
612612 our $global = " unmodified" ;
You can’t perform that action at this time.
0 commit comments