Stringio#ungetc crashes JRuby in some cases
-------------------------------------------

                 Key: JRUBY-2659
                 URL: http://jira.codehaus.org/browse/JRUBY-2659
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1.2
         Environment: Latest JRuby 1.1.2+
            Reporter: Vladimir Sizikov
            Assignee: Vladimir Sizikov
             Fix For: JRuby 1.1.3


ruby -rstringio -e "io = StringIO.new(); io.pos=2; io.ungetc(?A); p io.string" 
#==> "\000A"

But for JRuby:
{noformat}
jruby -rstringio -e "io = StringIO.new(); io.pos=2; io.ungetc(?A); p io.string"
Exception in thread "main" java.lang.IndexOutOfBoundsException
        at org.jruby.util.ByteList.set(ByteList.java:274)
        at org.jruby.RubyStringIO.ungetc(RubyStringIO.java:772)
        at org.jruby.RubyStringIOInvoker$ungetc_method_1_0.call(Unknown Source)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:149)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:356)
        at ruby.__dash_e__.__file__(-e:1)
        at ruby.__dash_e__.__file__(-e)
        at ruby.__dash_e__.load(-e)
        at org.jruby.Ruby.runScript(Ruby.java:520)
        at org.jruby.Ruby.runNormally(Ruby.java:440)
        at org.jruby.Ruby.runFromMain(Ruby.java:320)
        at org.jruby.Main.run(Main.java:184)
        at org.jruby.Main.run(Main.java:91)
        at org.jruby.Main.main(Main.java:82)
{noformat}

This also crases the rubyspec run.

Will fix shortly.


-- 
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


Reply via email to