This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #78194] Make sort copy PADTMPs
authorFather Chrysostomos <sprout@cpan.org>
Thu, 27 Jun 2013 21:37:14 +0000 (14:37 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 26 Jul 2013 06:48:01 +0000 (23:48 -0700)
commit2b66f6d3f8ed213b634d0aabd64c764198e14656
tree90334c14e171b0d87b006475c07a1b061ad54427
parentda9e430b54f7fcb43be1674882e31b92f2aa8253
[perl #78194] Make sort copy PADTMPs

Copy PADTMPs (op return values) when there is a sort block/sub that is
not optimised away and we are not sorting in place, so that \$a == \$a
will return true.

Many ops return the same scalar each time, for efficiency; refgen (\)
knows about that and copies them, to hide the implementation detail,
but other ops (sort in this case) need to do the same thing.
pp_sort.c
t/op/sort.t