caller fails if origin file is not a .rb extension
--------------------------------------------------

                 Key: JRUBY-5408
                 URL: http://jira.codehaus.org/browse/JRUBY-5408
             Project: JRuby
          Issue Type: Bug
         Environment: jruby 1.6.0.RC1 (ruby 1.8.7 patchlevel 330) (2011-01-22 
517349e) (Java HotSpot(TM) Client VM 1.6.0_10) [Windows XP-x86-java]
            Reporter: Roger Pack
            Assignee: Thomas E Enebo


create file named "go" with contents:

p caller

Running it in jruby yields:

RubyArray.java:296:in `<init>': java.lang.NegativeArraySizeException
        from RubyArray.java:156:in `newArray'
        from Ruby.java:2796:in `newArray'
        from ThreadContext.java:788:in `createCallerBacktrace'
        from RubyKernel.java:1184:in `caller'
        from org/jruby/RubyKernel$s_method_0_1$RUBYINVOKER$caller.gen:65535:in 
`call'
        from DynamicMethod.java:200:in `call'
        from DynamicMethod.java:196:in `call'
        from CachingCallSite.java:262:in `cacheAndCall'
        from CachingCallSite.java:105:in `call'
        from yo:1:in `__file__'
        from yo:-1:in `load'
        from Ruby.java:667:in `runScript'
        from Ruby.java:571:in `runNormally'
        from Ruby.java:420:in `runFromMain'
        from Main.java:275: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'

I believe this also causes later errors, like 

def go
 p caller
end
go

printing []

which is also unexpected, I believe.
Enjoy.
-r

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