This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change save/restore behavior for comparisons
authorjpl <jpl.jpl@gmail.com>
Mon, 28 Aug 2017 13:54:15 +0000 (09:54 -0400)
committerTony Cook <tony@develop-help.com>
Thu, 21 Sep 2017 01:00:41 +0000 (11:00 +1000)
commit0e1d050c8bc9db9872018aa565cc957f8169e50c
tree039b05011266c3171f420330e893867ad73d2666
parent8200f8061dc056efb643917d5e90c8ee0aad8fd2
Change save/restore behavior for comparisons

S_mergesortsv was saving the current comparison routine only when the
SORTf_DESC flag was set, but "restoring" it when ANY flag was set.
When some flag other than SORTf_DESC was set, this could lead to
the pointer to the comparison routine being set to NULL,
triggering a segfault when the routine was subsequently invoked.
lib/sort.t
pp_sort.c