Skip to content

Commit

Permalink
Merge branch 'jruby-9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 12, 2018
2 parents acf72b1 + 73808fb commit 0cd6a92
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/RubyNumeric.java
Expand Up @@ -1131,6 +1131,7 @@ public static RubyNumeric intervalStepSize(ThreadContext context, IRubyObject fr
if (diff == 0) {
return RubyFloat.newFloat(runtime, Double.POSITIVE_INFINITY);
}
// overflow checking
long toLong = ((RubyFixnum) to).getLongValue();
long fromLong = ((RubyFixnum) from).getLongValue();
delta = toLong - fromLong;
Expand All @@ -1146,6 +1147,7 @@ public static RubyNumeric intervalStepSize(ThreadContext context, IRubyObject fr
return runtime.newFixnum(0);
}

// overflow checking
long steps = delta / diff;
long stepSize = steps + 1;
if (stepSize != Long.MIN_VALUE) {
Expand Down

0 comments on commit 0cd6a92

Please sign in to comment.