JRuby with joni breaks hard on some regexps
-------------------------------------------
Key: JRUBY-1646
URL: http://jira.codehaus.org/browse/JRUBY-1646
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.x
Environment: Ubuntu Linux, Latest JRuby 1.1b1 trunk
Reporter: Vladimir Sizikov
Priority: Critical
Try this one:
"blah, 00-06".sub(/\b(\d{2}|\d{4})-(\d{2,3})\b/n, " ")
For me, JRuby throws an exception and terminates:
# jruby -e '"blah, 00-06".sub(/\b(\d{2}|\d{4})-(\d{2,3})\b/n, " ")'
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
at org.joni.ByteCodeMachine.opWordBoundSb(ByteCodeMachine.java:1047)
at org.joni.ByteCodeMachine.matchAt(ByteCodeMachine.java:394)
at org.joni.Matcher.match(Matcher.java:571)
at org.joni.Matcher.search(Matcher.java:725)
at org.jruby.RubyRegexp.search(RubyRegexp.java:489)
at org.jruby.RubyString.sub_bang(RubyString.java:1633)
at org.jruby.RubyString.sub(RubyString.java:1603)
at org.jruby.RubyStringInvoker$sub_method_1_1.call(Unknown Source)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:158)
at
org.jruby.runtime.CallSite$ArgumentBoxingCallSite.call(CallSite.java:103)
at __dash_e__.__file__(-e:1)
at __dash_e__.load(-e)
at org.jruby.Ruby.runScript(Ruby.java:577)
at org.jruby.Ruby.runNormally(Ruby.java:507)
at org.jruby.Ruby.runFromMain(Ruby.java:430)
at org.jruby.Main.runInterpreter(Main.java:214)
at org.jruby.Main.runInterpreter(Main.java:170)
at org.jruby.Main.run(Main.java:119)
at org.jruby.Main.run(Main.java:93)
at org.jruby.Main.main(Main.java:84)
This crash is encountered when trynig to execute MRI's time tests, so it's
pretty important to fix it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email