jruby/jruby — pull request #1714 by atambo (2014-05-24 07:43:50+00:00)
Title: String#rindex should handle matchdata strings

A string extracted from a matchdata object shares the same
byte array as the string it was matched against. When doing a
rindex between a string from a matchdata and the string the matchdata
was matched against the same byte array is passed into ```ByteList.memcmp```
which will always return 0 as ```ByteList.memcmp``` just checks for equality
of the byte arrays.

I fix this by passing ```bytes()``` instead ```getUnsafeBytes()``` into the
```ByteList.memcmp``` method so that the byte arrays are different.

Fixes #1688