Please sign in to comment.
[JVM] Avoid StringIndexOutOfBoundsException
This is only a quick workaround to make rakudo-j usable for the release. The old code led to a StringIndexOutOfBoundsException, because nqp::substr was called with -1 as the third positional parameter ($length). On MoarVM this seems to mean "go to the end of the string" -- cmp. https://github.com/MoarVM/MoarVM/blob/8eb232dbcc/src/strings/ops.c#L716-L718 A cleaner fix would probably be to let nqp::substr work similar on the JVM backend. But that's for after the release.
- Loading branch information...
Showing with 4 additions and 2 deletions.