diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-18 16:38:49 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-18 17:46:23 -0800 |
commit | 7d8b4ed398c3ccc6e5c4965c08a910c72d547f7f (patch) | |
tree | d4d1fe2f07a3f18e777a99726ccec803dcd83eef /t | |
parent | 107c452c64d52e8f29626debd8bdd4c5bc9a0e47 (diff) | |
download | perl-7d8b4ed398c3ccc6e5c4965c08a910c72d547f7f.tar.gz |
Fix pp_goto crash with orphaned GV
a7999c089 inadvertently made pp_goto crash if the GV had no
stash pointer.
Diffstat (limited to 't')
-rw-r--r-- | t/run/switchd.t | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/t/run/switchd.t b/t/run/switchd.t index 9246b35229..eadcd94053 100644 --- a/t/run/switchd.t +++ b/t/run/switchd.t @@ -9,7 +9,7 @@ BEGIN { require "./test.pl"; } # This test depends on t/lib/Devel/switchd*.pm. -plan(tests => 6); +plan(tests => 7); my $r; @@ -94,3 +94,19 @@ like( qr "1\r?\n2\r?\n", 'Subroutines no longer found under their names can be called', ); + +# [rt.cpan.org #69862] +like( + runperl( + switches => [ '-Ilib', '-d:switchd_empty' ], + progs => [ + 'sub DB::sub { goto &$DB::sub }', + 'sub foo { goto &bar::baz; }', + 'sub bar::baz { print qq _ok\n_ }', + 'delete $::{bar::::};', + 'foo();', + ], + ), + qr "ok\r?\n", + 'No crash when calling orphaned subroutine via goto &', +); |