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

Issue #3324 #3327

Merged
merged 1 commit into from Sep 15, 2015
Merged

Issue #3324 #3327

merged 1 commit into from Sep 15, 2015

Conversation

@bitfurry
Copy link
Contributor

@bitfurry bitfurry commented Sep 15, 2015

The issue was that _id2ref function was retruing nil value. I fixed it to throw a RangeError. Please correct me if I am wrong at any point.

jruby_pullrequest

@kares
Copy link
Member

@kares kares commented Sep 15, 2015

najs, would you mind cleaning-up the commits ? git squash them into one and maybe avoid touching truffle/src/main/ruby/core/rubinius/common/object_space.rb as the truffle part is unaffected ...

@@ -114,7 +114,7 @@ public static IRubyObject id2ref(IRubyObject recv, IRubyObject id) {
return object;
} else {
runtime.getWarnings().warn("ObjectSpace is disabled; _id2ref only supports immediates, pass -X+O to enable");
return runtime.getNil();
throw recv.getRuntime().newRangeError(id+" This is not id value");

This comment has been minimized.

@chrisseaton

chrisseaton Sep 15, 2015
Contributor

Can you try to replicate the error message exactly? It should be 0x00000000000000 is not id value, which you can probably make with String.format('%016x is not id value', id).

This comment has been minimized.

@bitfurry

bitfurry Sep 15, 2015
Author Contributor

@chrisseaton I will do it.

@@ -35,8 +35,7 @@ def self._id2ref(id)
if find_object([:object_id, Integer(id)], ary) > 0
return ary.first
end

return nil
return nil

This comment has been minimized.

@chrisseaton

chrisseaton Sep 15, 2015
Contributor

This is a valid commit, but it should be separate from this PR.

This comment has been minimized.

@bitfurry

bitfurry Sep 15, 2015
Author Contributor

Okay, I will create a seperate PR.

This comment has been minimized.

@eregon

eregon Sep 15, 2015
Member

How is this valid?

This comment has been minimized.

@chrisseaton

chrisseaton Sep 15, 2015
Contributor

Hmm now you've said that yeah it doesn't make sense. Don't worry - I'll revert it.

This comment has been minimized.

@bitfurry

bitfurry Sep 15, 2015
Author Contributor

@chrisseaton do I need to revert my whole commit or you will revert this part only ?

This comment has been minimized.

@chrisseaton

chrisseaton Sep 15, 2015
Contributor

Don't worry - I fixed it in 6b911f3.

This comment has been minimized.

@bitfurry

bitfurry Sep 15, 2015
Author Contributor

Thanks 👍

@nirvdrum
Copy link
Contributor

@nirvdrum nirvdrum commented Sep 15, 2015

@bitfurry Thanks for the patch! In the future, please include the issue title or some other context in the commit message. We have a fair number of people that use the JRuby repository without constant access to GitHub. While "issue #3324" links great on GitHub site, it's far less usable from the command-line or non-GitHub mirrors.

- fixes #3324 and #3327
@chrisseaton
Copy link
Contributor

@chrisseaton chrisseaton commented Sep 15, 2015

The failure looks unrelated, and I'll merge now rather than pestering you about the unrelated line again.

Thanks very much for your contribution!

chrisseaton added a commit that referenced this pull request Sep 15, 2015
_id2ref should raise RangeError rather than return nil for no object found
@chrisseaton chrisseaton merged commit 772f173 into jruby:master Sep 15, 2015
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@chrisseaton chrisseaton added the core label Sep 15, 2015
@chrisseaton chrisseaton added this to the JRuby 9.0.2.0 milestone Sep 15, 2015
eregon added a commit that referenced this pull request Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants