From 151f679354420c3b0885452adfe0de72855ba7ee Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 11 Jul 2006 06:47:09 +0000 Subject: * bignum.c (rb_int2big): use SIGNED_VALUE. [ruby-dev:29019] * bignum.c (rb_int2inum, rb_uint2inum): use VALUE sized integer. * bignum.c (rb_big2long, rb_big2ulong): ditto. * numeric.c (rb_num2long, rb_num2ulong): ditto. * numeric.c (check_int, check_uint): ditto. * bignum.c (rb_quad_pack): typo fixed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index aa0010d92..ad976f4c2 100644 --- a/eval.c +++ b/eval.c @@ -8555,10 +8555,13 @@ VALUE rb_proc_yield(int argc, VALUE *argv, VALUE proc) { switch (argc) { + case 1: + if (!NIL_P(argv[0])) { + return proc_invoke(proc, argv[0], Qundef, 0, 0); + } + /* fall through */ case 0: return proc_invoke(proc, Qundef, Qundef, 0, 0); - case 1: - return proc_invoke(proc, argv[0], Qundef, 0, 0); default: return proc_invoke(proc, rb_ary_new4(argc, argv), Qundef, 0, 0); } -- cgit