diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-09-17 00:27:14 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-09-17 00:27:14 -0700 |
commit | 426a09cda0fa65ac09901aeb0de4b8be77b13ee8 (patch) | |
tree | 94362e05755f94c318e6fe54044233f705a9a129 /t/op | |
parent | e8ed61c58cadd53d80a36d3e3a3fa0abdb90834d (diff) | |
download | perl-426a09cda0fa65ac09901aeb0de4b8be77b13ee8.tar.gz |
Fix recursion warning for ‘no warnings; goto &sub’
Commit 309aab3a made goto &foo make the lexical hints of the caller of
the sub containing the goto visible when foo is called. CORE subs
need this to function properly when ‘goneto’. But in that commit I
put the PL_curcop assignment before the recursion check, causing the
warning settings of the caller to be used, instead of those at the
goto. This commit moves the PL_curcop further down in pp_goto.
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/goto.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/op/goto.t b/t/op/goto.t index 5fa3116e0b..f2f91629ec 100644 --- a/t/op/goto.t +++ b/t/op/goto.t @@ -10,7 +10,7 @@ BEGIN { use warnings; use strict; -plan tests => 77; +plan tests => 78; our $TODO; my $deprecated = 0; @@ -415,7 +415,11 @@ sub recurse2 { my $x = shift; $_[0] ? +1 + recurse1($_[0] - 1) : 0 } +my $w = 0; +$SIG{__WARN__} = sub { ++$w }; is(recurse1(500), 500, 'recursive goto &foo'); +is $w, 0, 'no recursion warnings for "no warnings; goto &sub"'; +delete $SIG{__WARN__}; # [perl #32039] Chained goto &sub drops data too early. |