summaryrefslogtreecommitdiff
path: root/dist/Storable/t/destroy.t
blob: e9464fb40dd766105ef364c4518a63472be507d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# [perl #118139] crash in global destruction when accessing the freed cxt.
use Test::More tests => 1;
use Storable;
BEGIN {
  store {}, "foo";
}
package foo;
sub new { return bless {} }
DESTROY {
  open FH, "<foo" or die $!;
  eval { Storable::pretrieve(*FH); };
  close FH or die $!;
  unlink "foo";
}

package main;
# print "# $^X\n";
$x = foo->new();

ok(1);