Ranges as Conditions does not work
----------------------------------
Key: JRUBY-1400
URL: http://jira.codehaus.org/browse/JRUBY-1400
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.0.1, JRuby 1.0.0
Environment: Solaris Nevada
Reporter: Neelakanth Nadgir
The following simple program dies with the java exception
jruby -ne 'ARGF.each{|line| print line if /root/../nobody/}' /etc/passwd
It works under ruby 1.8.5
Exception is
DynamicScope.java:93:in `org.jruby.runtime.DynamicScope.getValue':
java.lang.ArrayIndexOutOfBoundsException: 2 (NativeException)
from EvaluationState.java:1082:in
`org.jruby.evaluator.EvaluationState.flipNode'
from EvaluationState.java:257:in
`org.jruby.evaluator.EvaluationState.evalInternal'
from EvaluationState.java:270:in
`org.jruby.evaluator.EvaluationState.evalInternal'
from EvaluationState.java:164:in
`org.jruby.evaluator.EvaluationState.eval'
from Block.java:220:in `org.jruby.runtime.Block.yield'
from Block.java:186:in `org.jruby.runtime.Block.yield'
from RubyArgsFile.java:240:in `org.jruby.RubyArgsFile.each_line'
from null:-1:in `org.jruby.RubyArgsFileInvokereach_linexx1.call'
... 14 levels...
from Main.java:120:in `org.jruby.Main.run'
from Main.java:95:in `org.jruby.Main.main'
from -e:1
Complete Java stackTrace
java.lang.ArrayIndexOutOfBoundsException: 2
at org.jruby.runtime.DynamicScope.getValue(DynamicScope.java:93)
at
org.jruby.evaluator.EvaluationState.flipNode(EvaluationState.java:1082)
at
org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:257)
at
org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:270)
at org.jruby.evaluator.EvaluationState.eval(EvaluationState.java:164)
at org.jruby.runtime.Block.yield(Block.java:220)
at org.jruby.runtime.Block.yield(Block.java:186)
at org.jruby.RubyArgsFile.each_line(RubyArgsFile.java:240)
at org.jruby.RubyArgsFileInvokereach_linexx1.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.evaluator.EvaluationState.callNode(EvaluationState.java:583)
at
org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:207)
at
org.jruby.evaluator.EvaluationState.rootNode(EvaluationState.java:1611)
at
org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:356)
at
org.jruby.evaluator.EvaluationState.optNNode(EvaluationState.java:1434)
at
org.jruby.evaluator.EvaluationState.evalInternal(EvaluationState.java:337)
at org.jruby.evaluator.EvaluationState.eval(EvaluationState.java:164)
at org.jruby.Ruby.eval(Ruby.java:290)
at org.jruby.Ruby.compileOrFallbackAndRun(Ruby.java:318)
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)
--
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