This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don’t skip tied EXISTS for negative array indices
authorFather Chrysostomos <sprout@cpan.org>
Sun, 28 Oct 2012 08:44:31 +0000 (01:44 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 28 Oct 2012 09:04:58 +0000 (02:04 -0700)
commit0960ff5ae77d081b538d8f0690367bb5144cf1c1
tree71a74f76100f68dfb29ebe268827bbb76c06f3ad
parentc06ecf4f38015d4985dd5994aebe5c15908d2f26
Don’t skip tied EXISTS for negative array indices

This was broken in 5.14.0 for those cases where $NEGATIVE_INDICES is
not true:

sub TIEARRAY{bless[]};
sub FETCHSIZE { 50 }
sub EXISTS { print "does $_[1] exist?\n" }
tie @a, "";
exists $a[1];
exists $a[-1];
$NEGATIVE_INDICES=1;
exists $a[-1];

$ pbpaste|perl5.12.0
does 1 exist?
does 49 exist?
does -1 exist?
$ pbpaste|perl5.14.0
does 1 exist?
does -1 exist?

This was broken by 54a4274e3c.
av.c
t/op/tie.t