summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/t/op/closure.t
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-08-09 18:10:42 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-08-09 18:10:42 +0000
commitb30707e4885ca231ff72a496671faa7830e8002a (patch)
treeceefb7d8635e495c31ba663e183cdcad8a9b157c /gnu/usr.bin/perl/t/op/closure.t
parent3c5182ca6f3c3cb0d292743e65788c0b1d03b596 (diff)
merge 5.8.5 into HEAD
remove now-unused files crank libperl shared library major number update Makefile.bsd-wrapper tweak openbsd hints file for arm and m68k
Diffstat (limited to 'gnu/usr.bin/perl/t/op/closure.t')
-rw-r--r--gnu/usr.bin/perl/t/op/closure.t25
1 files changed, 24 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/t/op/closure.t b/gnu/usr.bin/perl/t/op/closure.t
index 866922d2ac6..de9e102a7f5 100644
--- a/gnu/usr.bin/perl/t/op/closure.t
+++ b/gnu/usr.bin/perl/t/op/closure.t
@@ -13,7 +13,7 @@ BEGIN {
use Config;
-print "1..185\n";
+print "1..187\n";
my $test = 1;
sub test (&) {
@@ -641,4 +641,27 @@ __EOF__
END { 1 while unlink $progfile }
}
+{
+ # bugid #24914 = used to coredump restoring PL_comppad in the
+ # savestack, due to the early freeing of the anon closure
+
+ my $got = runperl(stderr => 1, prog =>
+'sub d {die} my $f; $f = sub {my $x=1; $f = 0; d}; eval{$f->()}; print qq(ok\n)'
+ );
+ test { $got eq "ok\n" };
+}
+# After newsub is redefined outside the BEGIN, it's CvOUTSIDE should point
+# to main rather than BEGIN, and BEGIN should be freed.
+
+{
+ my $flag = 0;
+ sub X::DESTROY { $flag = 1 }
+ {
+ my $x;
+ BEGIN {$x = \&newsub }
+ sub newsub {};
+ $x = bless {}, 'X';
+ }
+ test { $flag == 1 };
+}