This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add some defensive coding to av_store()
authorKarl Williamson <khw@cpan.org>
Sat, 1 Jun 2019 20:39:55 +0000 (14:39 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 27 Jun 2019 15:36:35 +0000 (09:36 -0600)
commitbc62bf8519f9005df2fb29dbd3d330202b258b6b
tree3ccdb243600b6cf92743c87627115193c8b68e38
parent1bed9104d475eb126ab7d1df518bb894f66e1fab
Add some defensive coding to av_store()

Don't decrement the reference count of the element about to be stored
into.

Likely, this is an error in the caller, but doing this action blindly is
like shooting yourself in the foot.  The branch prediction also added
ensures this shouldn't slow things down.

See http://nntp.perl.org/group/perl.perl5.porters/254974
av.c