diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-11 09:47:15 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-11 09:47:15 +0000 |
commit | 5f257cf403a0316ee005b5cc476b04dbf9ca86ec (patch) | |
tree | 733f6877361177c8ceb95c6ed169c5dc4b49c064 /enumerator.c | |
parent | 7590de68e2102d586a1fb4e34642643b3c731269 (diff) | |
download | ruby-5f257cf403a0316ee005b5cc476b04dbf9ca86ec.tar.gz |
* 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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/enumerator.c b/enumerator.c index 022690a2a3..3aa0d2ea78 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); } |