Subject: | suspected XS bug |
I went source diving in the xs and was unable to find anything wonky... but if you run the attached test file in perl 5.16.x or higher, you'll see that the xs exposes a type of internal array that users shouldn't have access to even doing something as dumb as the attached. Probably not a problem for any real use cases, but indicates a possible memory allocation problem.
--
If riding in an airplane is flying, then riding in a boat is swimming.
116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
Subject: | bug.pl |
package dumb_thing;
use strict; use warnings;
use Tie::Array;
use Carp;
use base 'Tie::StdArray';
sub TIEARRAY {
my $class = shift;
my $this = bless [], $class;
my $that = shift;
@$this = @$that;
$this;
}
package main;
use strict; use warnings;
use Storable qw(freeze thaw);
my $x = [1,2,3,4];
broken($x); # works fine around the world
broken( thaw( freeze($x) ) ); # broken in 5.16 and 5.17
sub broken {
my $w = shift;
tie @$_, dumb_thing => $_ for $w;
}