This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "Add some defensive coding to av_store()"
authorKarl Williamson <khw@cpan.org>
Thu, 2 Jan 2020 17:09:31 +0000 (10:09 -0700)
committerKarl Williamson <khw@cpan.org>
Thu, 2 Jan 2020 17:16:24 +0000 (10:16 -0700)
commit811f8a246ee7da5274c3229345222e9fe5febbe0
treeb55f671469eb4865f27ac982c9d3e11cc6cbb1d5
parentb790ed71bdb9ac73a66f9dc2639f19950391ed45
Revert "Add some defensive coding to av_store()"

This reverts commit bc62bf8519f9005df2fb29dbd3d330202b258b6b.

As Dave Mitchell said in <Perl/perl5/issues/17265/570253376@github.com>

"The docs for av_store() say that the caller is responsible for first
incrementing the ref count of the new SV before passing it to
av_store(). In the normal case of the two elements being different,
av_store() will decrement the old SV before storing the new one, and
everything is good. When the two elements are the same SV, av_store()
*still* needs to decrement the ref count, to undo the increment the
caller just did."

This should resolve GH #17265
av.c