summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/enumerator.c b/enumerator.c
index 2c115aa740..46ded3760e 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -2661,7 +2661,8 @@ arith_seq_each(VALUE self)
s = arith_seq_step(self);
x = arith_seq_exclude_end_p(self);
- if (ruby_float_step(c, e, s, x, TRUE)) {
+ if (RB_TYPE_P(c, T_FLOAT) && RB_TYPE_P(s, T_FLOAT) &&
+ ruby_float_step(c, e, s, x, TRUE)) {
return self;
}