Skip to content

Commit

Permalink
Don't access arg 0 blindly after negotiating it above. Fixes #4461
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Jan 27, 2017
1 parent 6b27592 commit 52cc127
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyObjectSpace.java
Expand Up @@ -149,7 +149,7 @@ public Object apply(IRubyObject arg1) {
}
return runtime.newFixnum(count);
}
if (args[0].getClass() == MetaClass.class) {
if (rubyClass.getClass() == MetaClass.class) {
// each_object(Cls.singleton_class) is basically a walk of Cls and all descendants of Cls.
// In other words, this is walking all instances of Cls's singleton class and its subclasses.
IRubyObject attached = ((MetaClass) args[0]).getAttached();
Expand Down

0 comments on commit 52cc127

Please sign in to comment.