This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #94390] Optimised numeric sort should warn for nan
authorFather Chrysostomos <sprout@cpan.org>
Thu, 13 Oct 2011 05:53:31 +0000 (22:53 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 13 Oct 2011 06:28:30 +0000 (23:28 -0700)
commitf3dab52a514ffb23bcde784e897bc8ff4c2018f2
tree45c51bbc2acab5a8f5d757a3c76e4943bbdfa712
parentd4c6760ad383a9419aef88be3abd479ebcfb6d36
[perl #94390] Optimised numeric sort should warn for nan

In this case:

    sort { $a <=> $b } ...

the sort block is optimised away and implemented in C.

That C implementation did not take into account that $a or $b might be
nan, and therefore, without optimisation, would return undef, result-
ing in a warning.

The optimisation is supposed to be just that, and not change
behaviour.
pp_sort.c
t/lib/warnings/9uninit