Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_id2ref should raise RangeError rather than return nil for no object found #3324

Closed
chrisseaton opened this issue Sep 14, 2015 · 3 comments
Closed

Comments

@chrisseaton
Copy link
Contributor

JRuby:

irb(main):001:0> ObjectSpace._id2ref 545556
=> nil

MRI:

irb(main):001:0> ObjectSpace._id2ref 545556
RangeError: 0x00000000085314 is not id value
    from (irb):1:in `_id2ref'
    from (irb):1
    from /Users/chrisseaton/.rbenv/versions/2.2.3/bin/irb:11:in `<main>'
@b1tfury
Copy link
Contributor

b1tfury commented Sep 14, 2015

@chrisseaton can specify the versions of Jruby and MRI ?
As for MRI 2.2.2 and Jruby 9.0.2.0 is not showing this error.

@chrisseaton
Copy link
Contributor Author

$ ~/.rbenv/versions/1.8.7-p375/bin/irb
irb(main):001:0> ObjectSpace._id2ref 545556
RangeError: 0x85314 is not id value
    from (irb):1:in `_id2ref'
    from (irb):1
    from :0

$ ~/.rbenv/versions/1.9.3-p551/bin/irb
irb(main):001:0> ObjectSpace._id2ref 545556
RangeError: 0x00000000085314 is not id value
    from (irb):1:in `_id2ref'
    from (irb):1
    from /Users/chrisseaton/.rbenv/versions/1.9.3-p551/bin/irb:12:in `<main>'

$ ~/.rbenv/versions/2.0.0-p645/bin/irb
irb(main):001:0> ObjectSpace._id2ref 545556
RangeError: 0x00000000085314 is not id value
    from (irb):1:in `_id2ref'
    from (irb):1
    from /Users/chrisseaton/.rbenv/versions/2.0.0-p645/bin/irb:12:in `<main>'

 $ ~/.rbenv/versions/2.1.6/bin/irb
irb(main):001:0> ObjectSpace._id2ref 545556
RangeError: 0x00000000085314 is not id value
    from (irb):1:in `_id2ref'
    from (irb):1
    from /Users/chrisseaton/.rbenv/versions/2.1.6/bin/irb:11:in `<main>'

$ ~/.rbenv/versions/2.2.2/bin/irb 
irb(main):001:0> ObjectSpace._id2ref 545556
RangeError: 0x00000000085314 is not id value
  from (irb):1:in `_id2ref'
  from (irb):1
  from /Users/chrisseaton/.rbenv/versions/2.2.2/bin/irb:11:in `<main>'

$ ~/.rbenv/versions/2.2.3/bin/irb 
irb(main):001:0> ObjectSpace._id2ref 545556
RangeError: 0x00000000085314 is not id value
  from (irb):1:in `_id2ref'
  from (irb):1
  from /Users/chrisseaton/.rbenv/versions/2.2.3/bin/irb:11:in `<main>'

$ ~/.rbenv/versions/jruby-1.7.22/bin/ruby -X+O -S irb
irb(main):001:0> ObjectSpace._id2ref 545556
=> nil

$ ~/.rbenv/versions/jruby-9.0.0.0/bin/ruby -X+O -S irb
irb(main):001:0> ObjectSpace._id2ref 545556
=> nil

$ ~/.rbenv/versions/jruby-9.0.1.0/bin/ruby -X+O -S irb
irb(main):001:0> ObjectSpace._id2ref 545556
=> nil

$ bin/jruby -X+O -S irb
irb(main):001:0> ObjectSpace._id2ref 545556
=> nil

$ ~/.rbenv/versions/rbx-2.5.8/bin/irb
irb(main):001:0> ObjectSpace._id2ref 545556
=> nil

@b1tfury
Copy link
Contributor

b1tfury commented Sep 15, 2015

@chrisseaton I fixed the issue. Please feel to comment on my pull request.

@nirvdrum nirvdrum mentioned this issue Sep 15, 2015
@enebo enebo added this to the JRuby 9.0.2.0 milestone Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants