This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In-place sort should not leave array read-only
authorFather Chrysostomos <sprout@cpan.org>
Wed, 26 Jun 2013 07:18:03 +0000 (00:18 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 26 Jun 2013 08:12:10 +0000 (01:12 -0700)
commit20d5dc239d1bc8440adfec25faf617e0e444f64e
tree8ebab95b5783396ff210544b5e03d3317dfd7706
parentae3f739188e3ee21fa593cafc28023c533e8d9bf
In-place sort should not leave array read-only

$ ./perl -Ilib -e '@a=1..2; eval { @a=sort{die} @a }; warn "ok so far\n"; @a = 1'
ok so far
Modification of a read-only value attempted at -e line 1.

If something goes wrong inside the sort block and it dies, we still
need to make sure we turn off the read-only flag on that array.
pp_sort.c
scope.c
scope.h
t/op/sort.t