This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c: Further simplify ck_sort
authorFather Chrysostomos <sprout@cpan.org>
Sat, 14 Jul 2012 13:41:30 +0000 (06:41 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 15 Jul 2012 00:35:31 +0000 (17:35 -0700)
commitc650d6974333f05db3de6fe88357fb0e710220a3
treec9f9cd0723b68ee3611e4b0ed44ba0bf88454629
parent3be135d8cfe01725ff3bdfcc1b4a30206a1e0ed2
op.c: Further simplify ck_sort

This code currently chases op_next pointers in the sort block to make
sure there is none that can point outside.  To avoid getting stuck in
loops, it has to check for those explicitly.

Instead of nulling out any op_next pointer that points to the leave
op, we can simply turn the leave into a null op (which we already do)
and have the leave op’s op_next pointer point to nothing.

That produces the same result in the end:  Execution of the sort block
is prevented from running rampant and escaping out of it, but exits
the runloop instead, returning control to pp_sort.
op.c