eval of a "proc" with setting the line number for something lower than 1 to 
adjust the line number causes "java.lang.ArrayIndexOutOfBoundsException: -1 
(NativeException)"
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: JRUBY-1416
                 URL: http://jira.codehaus.org/browse/JRUBY-1416
             Project: JRuby
          Issue Type: Bug
         Environment: Ubuntu Linux,

[EMAIL PROTECTED]:~/Desktop/t_/jrb$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)

            Reporter: Joao Pedrosa
            Assignee: Thomas E Enebo


Notice the \n in the proc. Without it it does not crash. It does not crash when 
the line number is 1 as well. Sample:

s = "proc{\n}"
eval s, binding, 'file.rb', 0


Causes:

[EMAIL PROTECTED]:~/Desktop/t_/jrb$ /opt/jruby-1.0.1/bin/jruby e.rb
LexerSource.java:170:in `org.jruby.lexer.yacc.LexerSource.unread': 
java.lang.ArrayIndexOutOfBoundsException: -1 (NativeException)
        from RubyYaccLexer.java:1438:in 
`org.jruby.lexer.yacc.RubyYaccLexer.yylex'
        from RubyYaccLexer.java:123:in 
`org.jruby.lexer.yacc.RubyYaccLexer.advance'
        from DefaultRubyParser.java:883:in 
`org.jruby.parser.DefaultRubyParser.yyparse'
        from DefaultRubyParser.java:835:in 
`org.jruby.parser.DefaultRubyParser.yyparse'
        from DefaultRubyParser.java:3299:in 
`org.jruby.parser.DefaultRubyParser.parse'
        from Parser.java:89:in `org.jruby.parser.Parser.parse'
        from Parser.java:61:in `org.jruby.parser.Parser.parse'
        from Ruby.java:1039:in `org.jruby.Ruby.parse'
         ... 13 levels...
        from Main.java:120:in `org.jruby.Main.run'
        from Main.java:95:in `org.jruby.Main.main'
        from :1
Complete Java stackTrace
java.lang.ArrayIndexOutOfBoundsException: -1
        at org.jruby.lexer.yacc.LexerSource.unread(LexerSource.java:170)
        at org.jruby.lexer.yacc.RubyYaccLexer.yylex(RubyYaccLexer.java:1438)
        at org.jruby.lexer.yacc.RubyYaccLexer.advance(RubyYaccLexer.java:123)
        at 
org.jruby.parser.DefaultRubyParser.yyparse(DefaultRubyParser.java:883)
        at 
org.jruby.parser.DefaultRubyParser.yyparse(DefaultRubyParser.java:835)
        at org.jruby.parser.DefaultRubyParser.parse(DefaultRubyParser.java:3299)
        at org.jruby.parser.Parser.parse(Parser.java:89)
        at org.jruby.parser.Parser.parse(Parser.java:61)
        at org.jruby.Ruby.parse(Ruby.java:1039)
        at org.jruby.RubyObject.evalWithBinding(RubyObject.java:896)
        at org.jruby.RubyKernel.eval(RubyKernel.java:801)
        at org.jruby.RubyKernelInvokerSevalxx1.call(Unknown Source)
        at 
org.jruby.runtime.callback.InvocationCallback.execute(InvocationCallback.java:49)
        at 
org.jruby.internal.runtime.methods.FullFunctionCallbackMethod.internalCall(FullFunctionCallbackMethod.java:78)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:79)
        at org.jruby.RubyObject.compilerCallMethod(RubyObject.java:508)
        at 
org.jruby.javasupport.util.CompilerHelpers.doInvokeDynamic(CompilerHelpers.java:124)
        at EVAL27959193.__file__(EVAL27959193:2)
        at EVAL27959193.run(EVAL27959193)
        at org.jruby.Ruby.compileOrFallbackAndRun(Ruby.java:322)
        at org.jruby.Main.runInterpreter(Main.java:229)
        at org.jruby.Main.runInterpreter(Main.java:174)
        at org.jruby.Main.run(Main.java:120)
        at org.jruby.Main.main(Main.java:95)


I have plenty of code that depends on the fixing of this error BTW. :-)

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