Compiler trips up on a combination of send and eval (concocted example)
-----------------------------------------------------------------------
Key: JRUBY-5486
URL: http://jira.codehaus.org/browse/JRUBY-5486
Project: JRuby
Issue Type: Bug
Components: Compiler
Environment: Linux 2.6.32-28-generic #55-Ubuntu SMP
jruby 1.6.0.RC2 (ruby 1.8.7 patchlevel 330) (2011-02-10 a78f2b3) (Java
HotSpot(TM) Client VM 1.6.0_22) [linux-i386-java]
Reporter: Subbu Sastry
Priority: Minor
[subbu@earth jruby] cat /tmp/bad.rb
class C
def foo(mname, expr)
a=1
b=2
C.send(mname, expr)
puts "b is #{b}"
end
end
C.new.foo("eval", "b=a+3")
[subbu@earth jruby] ruby /tmp/bad.rb
b is 4
[subbu@earth jruby] jruby -X-C /tmp/bad.rb
b is 4
[subbu@earth jruby] jruby /tmp/bad.rb
NoVarsDynamicScope.java:53:in `getValue': java.lang.NullPointerException
from ManyVarsDynamicScope.java:66:in `getValue'
from LocalVarNode.java:116:in `interpret'
from CallOneArgFixnumNode.java:59:in `interpret'
from LocalAsgnNode.java:123:in `interpret'
from NewlineNode.java:103:in `interpret'
from RootNode.java:129:in `interpret'
from ASTInterpreter.java:95:in `INTERPRET_EVAL'
from ASTInterpreter.java:160:in `evalWithBinding'
from RubyKernel.java:1135:in `evalCommon'
from RubyKernel.java:1088:in `eval'
from org/jruby/RubyKernel$s_method_0_3$RUBYINVOKER$eval.gen:65535:in
`call'
from DynamicMethod.java:209:in `call'
from RubyClass.java:563:in `finvoke'
from RubyBasicObject.java:2749:in `send'
from RubyKernel.java:2043:in `send'
from org/jruby/RubyKernel$s_method_multi$RUBYINVOKER$send.gen:65535:in
`call'
from JavaMethod.java:283:in `call'
from CachingCallSite.java:302:in `cacheAndCall'
from CachingCallSite.java:173:in `call'
from /tmp/bad.rb:5:in `method__1$RUBY$foo'
from tmp_badInvokermethod__1$RUBY$fooFixed2#foo:65535:in `call'
from tmp_badInvokermethod__1$RUBY$fooFixed2#foo:65535:in `call'
from CachingCallSite.java:302:in `cacheAndCall'
from CachingCallSite.java:173:in `call'
from /tmp/bad.rb:11:in `__file__'
from /tmp/bad.rb:-1:in `load'
from Ruby.java:667:in `runScript'
from Ruby.java:571:in `runNormally'
from Ruby.java:420:in `runFromMain'
from Main.java:278:in `doRunFromMain'
from Main.java:198:in `internalRun'
from Main.java:164:in `run'
from Main.java:148:in `run'
from Main.java:128:in `main'
--
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