summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-11 09:47:15 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-11 09:47:15 +0000
commit5f257cf403a0316ee005b5cc476b04dbf9ca86ec (patch)
tree733f6877361177c8ceb95c6ed169c5dc4b49c064 /enumerator.c
parent7590de68e2102d586a1fb4e34642643b3c731269 (diff)
* enumerator.c (enumerator_with_index): try to convert given offset to
integer. fix bug introduced in r39594. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/enumerator.c b/enumerator.c
index 022690a..3aa0d2e 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -494,6 +494,8 @@ enumerator_with_index(int argc, VALUE *argv, VALUE obj)
RETURN_SIZED_ENUMERATOR(obj, argc, argv, enumerator_size);
if (NIL_P(memo))
memo = INT2FIX(0);
+ else
+ memo = rb_to_int(memo);
return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)&memo);
}