summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/enumerator.c b/enumerator.c
index 9e48fddae3..35775b864b 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -2495,6 +2495,9 @@ arith_seq_last(int argc, VALUE *argv, VALUE self)
}
rb_scan_args(argc, argv, "1", &nv);
+ if (!RB_INTEGER_TYPE_P(nv)) {
+ nv = rb_to_int(nv);
+ }
if (RTEST(rb_int_gt(nv, len))) {
nv = len;
}