Skip to content

Commit

Permalink
[2.4] Fixes for Numeric recursion guard logic in ec800e6.
Browse files Browse the repository at this point in the history
* coerceBin should not recursion check
* RubyFixnum's old override of quo is deleted

For #4293.
headius committed Jun 27, 2017
1 parent 8d3b9aa commit c2a7ea2
Showing 2 changed files with 1 addition and 16 deletions.
15 changes: 0 additions & 15 deletions core/src/main/java/org/jruby/RubyFixnum.java
Original file line number Diff line number Diff line change
@@ -809,21 +809,6 @@ private IRubyObject divmodFixnum(ThreadContext context, RubyFixnum other) {
return RubyArray.newArray(runtime, integerDiv, fixMod);
}

/** fix_quo
*
*/
@Deprecated
@Override
public IRubyObject quo(ThreadContext context, IRubyObject other) {
if (other instanceof RubyFixnum) {
return RubyFloat.newFloat(context.runtime, (double) value / (double) ((RubyFixnum) other).value);
}
if (other instanceof RubyBignum) {
return RubyFloat.newFloat(context.runtime, (double) value / ((RubyBignum) other).getDoubleValue());
}
return coerceBin(context, sites(context).quo, other);
}

/** fix_pow
*
*/
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyNumeric.java
Original file line number Diff line number Diff line change
@@ -554,7 +554,7 @@ protected final IRubyObject coerceBin(ThreadContext context, String method, IRub
protected final IRubyObject coerceBin(ThreadContext context, CallSite site, IRubyObject other) {
RubyArray ary = doCoerce(context, other, true);
IRubyObject car = ary.eltInternal(0);
return numFuncall(context, car, site, ary.eltInternal(1));
return site.call(context, car, car, ary.eltInternal(1));
}

/** rb_num_coerce_bit

0 comments on commit c2a7ea2

Please sign in to comment.