Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayIndexOutOfBoundsException when utf8 string matched against regexp with with word boundary \b #3397

Closed
kml opened this issue Oct 15, 2015 · 6 comments
Milestone

Comments

@kml
Copy link

kml commented Oct 15, 2015

> p = "x".force_encoding("utf-8"); p.match(/x.*\b/)
Java::JavaLang::ArrayIndexOutOfBoundsException: 1
    from org.jcodings.specific.UTF8Encoding.length(UTF8Encoding.java:35)
    from org.jcodings.specific.BaseUTF8Encoding.mbcToCode(BaseUTF8Encoding.java:91)
    from org.jcodings.specific.UTF8Encoding.mbcToCode(UTF8Encoding.java:24)
    from org.jcodings.Encoding.isMbcWord(Encoding.java:469)
    from org.joni.ByteCodeMachine.opWordBound(ByteCodeMachine.java:1054)
    from org.joni.ByteCodeMachine.matchAt(ByteCodeMachine.java:239)
    from org.joni.Matcher.matchCheck(Matcher.java:304)
?> p = "x".bytes.to_a.pack('c*').force_encoding("utf-8"); p.match(/x.*\b/)
=> nil
@lopex
Copy link
Contributor

lopex commented Oct 15, 2015

Fixed in 5a13be3

@lopex lopex closed this as completed Oct 15, 2015
@kml
Copy link
Author

kml commented Oct 16, 2015

Thanks for fixing. How can I get link to commit?
It would be very helpfull if this could get to next 1.7 release also.

@kml
Copy link
Author

kml commented Oct 16, 2015

kml referenced this issue in jruby/joni Oct 16, 2015
@enebo enebo added this to the JRuby 9.0.3.0 milestone Oct 21, 2015
@Xanthus
Copy link

Xanthus commented Jan 13, 2016

Is this going to make it into the next 1.7 release?

@enebo
Copy link
Member

enebo commented Jan 13, 2016

@Xanthus @kml This will be in the next 1.7 release this week. I just updated our companion projects which contained the fixes.

@Xanthus
Copy link

Xanthus commented Jan 14, 2016

Great stuff, thanks!
On Wed, 13 Jan 2016 at 23:30, Thomas E Enebo notifications@github.com
wrote:

@Xanthus https://github.com/Xanthus @kml https://github.com/kml This
will be in the next 1.7 release this week. I just updated our companion
projects which contained the fixes.


Reply to this email directly or view it on GitHub
#3397 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants