This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove OA_DANGEROUS from sort
authorFather Chrysostomos <sprout@cpan.org>
Sat, 8 Nov 2014 20:30:33 +0000 (12:30 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 9 Nov 2014 00:06:42 +0000 (16:06 -0800)
commit61aeaf969d4829d2801f5ecc331dbd94627b2b8f
tree4fe1ea6533e86825755dcd386b82e1cedf4b92e3
parent15da1ccf5401cb5b69ab5ab40a17dd79ebcde211
Remove OA_DANGEROUS from sort

OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:

($a, $b) = ($b, $a);

In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.

pp_sort returns its arguments.  aassign_common_vars will check its kid
ops for danger as well, so it’s not necessary for sort itself to be
flagged this way.  This will allow cases like ($a,$b) = sort($c,$d) to
forego the temp copy.
opcode.h
regen/opcodes