It looks like the overflow still happens. (Expected result is different 
nowadays, since negative start positions are disallowed (see 
https://github.com/rakudo/rakudo/commit/fa3ce116e3).

See also http://irclog.perlgeek.de/perl6/2015-11-21#i_11577908

$ perl6-m -e 'say index("xxy", "y", 
-999999999999999999999999999999999999999999999999999999999999999)'
Nil

$ perl6-j -e 'say index("xxy", "y", 
-999999999999999999999999999999999999999999999999999999999999999)'
Position in index out of range. Is: -9223372036854775807, should be in 0..3
  in block <unit> at -e:1

Actually thrown at:
  in block <unit> at -e:1

There are fudged tests ('todo') for this in S32-str/index.t and 
S32-str/rindex.t.

Also nqp-m and nqp-j still behave differently:

$ nqp-m -e 'nqp::say(nqp::index("xxy", "y", 
-999999999999999999999999999999999999999999999999999999999999999))'
-1

$ nqp-j -e 'nqp::say(nqp::index("xxy", "y", 
-999999999999999999999999999999999999999999999999999999999999999))'
2

Reply via email to