diff --git a/ChangeLog b/ChangeLog index c4290f4481..c4c9007b14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Mar 5 12:24:23 2013 Eric Hodel + + * enumerator.c (enumerator_with_index): Restore handling of a nil memo + from r39594. + Tue Mar 5 10:40:22 2013 Nobuyoshi Nakada * ext/objspace/objspace.c (count_nodes): count also newly added nodes, diff --git a/enumerator.c b/enumerator.c index bd039d28bc..7143e37636 100644 --- a/enumerator.c +++ b/enumerator.c @@ -492,6 +492,8 @@ enumerator_with_index(int argc, VALUE *argv, VALUE obj) rb_scan_args(argc, argv, "01", &memo); RETURN_SIZED_ENUMERATOR(obj, argc, argv, enumerator_size); + if (NIL_P(memo)) + memo = INT2NUM(0); return enumerator_block_call(obj, enumerator_with_index_i, (VALUE)&memo); }