in-place sort retains blessedness #16304
Created by firstname.lastname@example.org
Suppose I have an array of which an element is blessed. (That is, the
$ perl -lwe '@a = qw(a b c); bless(\$a); print ref(\$a); @a = sort @a; print ref(\$a); @a = ((), sort @a); print ref(\$a)'
Obviously this is another fault of the in-place sort optimisation,
On Fri, 15 Dec 2017 00:01:36 -0800, email@example.com wrote:
We already have the infrastructure to unbless-in-place. See S_curse in sv.c. That could be used in fixing this.
Father Chrysostomos via RT wrote:
Doing that would not be correct, because of DESTROY methods. S_curse()
To avoid mutation, sort will have to use the newSVsv() slow path for