From 8bfcdf323f1843237140e9f119496b93557eaefd Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 25 Jun 2007 19:06:00 +0000 Subject: * insnhelper.ci (vm_yield_with_cfunc), proc.c: fix Method#to_proc to return lamba Proc ([ruby-dev:31021], [ruby-dev:31037]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 8d6ec0e8cd..59de71dd61 100644 --- a/proc.c +++ b/proc.c @@ -1312,10 +1312,17 @@ mproc(VALUE method) return rb_funcall(Qnil, rb_intern("proc"), 0); } +static VALUE +mlambda(VALUE method) +{ + return rb_funcall(Qnil, rb_intern("lambda"), 0); +} + static VALUE bmcall(VALUE args, VALUE method) { volatile VALUE a; + if (CLASS_OF(args) != rb_cArray) { args = rb_ary_new3(1, args); } @@ -1356,7 +1363,7 @@ method_proc(VALUE method) * end * end */ - proc = rb_iterate((VALUE (*)(VALUE))mproc, 0, bmcall, method); + proc = rb_iterate((VALUE (*)(VALUE))mlambda, 0, bmcall, method); return proc; } -- cgit v1.2.3