This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
threads::shared "$#shared = N" off-by-one error
RT #122950
my @a : shared;
$#a = 3; # actually set it to 4
There was a simple off-by-one error in the XS code that handled the
STORESIZE tie method (confusing the array size and fill, which differ
by 1).
Amazingly, there was no test for it, and no-one had noticed up until now.
Note that this commit causes three tests in object2.t to fail: this
is because fixing the $#shared bug exposed another bug that was being
masked by this one. They will be fixed in the next commit