Skip to content

Commit

Permalink
Fix initial value for index variable
Browse files Browse the repository at this point in the history
This index variable was wrongly initialized to 0 with commit 019a7ff.

Said commit reverted commit f0c6a02, but in this specific case some
related code was changed in the meantime with commit 3bbc922. That
lead to a situation where the corresponding change to the 'while'
clause 4 lines below was not reverted -- only the initialization of $i.

This lead to some fallout on rakudo.jvm: Even '1.sort' resulted in
a Null Pointer Exception. On rakudo.moar there seemed to be no
spectest fallout.
  • Loading branch information
usev6 committed Nov 17, 2015
1 parent 1dba450 commit 5da0b3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Any-iterable-methods.pm
Expand Up @@ -917,7 +917,7 @@ augment class Any {
# a slice into self. The JVM implementation uses a Java
# collection sort. MoarVM has its sort algorithm implemented
# in NQP.
my int $i = 0;
my int $i = -1;
my int $n = sort-buffer.elems;
my $indices := nqp::list;
nqp::setelems($indices,$n);
Expand Down

0 comments on commit 5da0b3f

Please sign in to comment.