Some names not being interned by parser / eval
----------------------------------------------

                 Key: JRUBY-1485
                 URL: http://jira.codehaus.org/browse/JRUBY-1485
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.1
         Environment: trunk (4779), Java 1.6, WinXp
            Reporter: Bill Dortch
            Assignee: Thomas E Enebo
            Priority: Critical


Apparently some names are not being interned, now that that's been removed from 
the AST nodes.  In particular, I've found a case where a SymbolNode name is not 
interned.  I can't provide a simple test case (I got this from an assertion in 
the concurrent SymbolTable code I was getting ready to commit), but it appears 
to result from an eval.  I initially encountered a failure in test_symbol, from 
line 64, which prompted me to add the assert.  Here's the line:
{noformat}
  assert_nothing_raised(SyntaxError) {assert_equal(sym, eval(':$-'))}
{noformat}


Here's a partial stack trace.  Note that the SymbolNode#getSymbol method in my 
code just passes the name stored at the node:
{noformat}
    [junit] Testcase: test_symbol(org.jruby.test.TestUnitTestSuite$ScriptTest): 
Caused an ERROR
    [junit] null
    [junit] java.lang.AssertionError
    [junit]     at 
org.jruby.RubySymbol$SymbolTable.fastGetSymbol(RubySymbol.java:399)
    [junit]     at org.jruby.Ruby.fastNewSymbol(Ruby.java:2061)
    [junit]     at org.jruby.ast.SymbolNode.getSymbol(SymbolNode.java:86)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.symbolNode(ASTInterpreter.java:1576)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:371)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.rootNode(ASTInterpreter.java:1514)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:357)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:165)
    [junit]     at org.jruby.RubyObject.evalWithBinding(RubyObject.java:761)
    [junit]     at org.jruby.RubyKernel.eval(RubyKernel.java:720)
    [junit]     at org.jruby.RubyKernelInvoker$eval_method_1_3.call(Unknown 
Source)
    [junit]     at 
org.jruby.runtime.CallAdapter$DefaultCallAdapter.call(CallAdapter.java:154)
    [junit]     at 
org.jruby.runtime.CallAdapter$DefaultCallAdapter.call(CallAdapter.java:107)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:996)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:254)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.setupArgs(ASTInterpreter.java:2066)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:991)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:254)
    [junit]     at 
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:165)
    [junit]     at org.jruby.runtime.Block.yield(Block.java:260)
{noformat}

I haven't tested whether this affects other eval-ed values, such as ivars, etc.

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