* proc.c (rb_proc_call_with_block): reduce comparison.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2008-07-31 16:02:18 +00:00
parent e40f25ae36
commit f3730b8260
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Fri Aug 1 01:01:49 2008 Yusuke Endoh <mame@tsg.ne.jp>
* proc.c (rb_proc_call_with_block): reduce comparison.
Wed Jul 30 21:08:06 2008 Yusuke Endoh <mame@tsg.ne.jp> Wed Jul 30 21:08:06 2008 Yusuke Endoh <mame@tsg.ne.jp>
* ext/syck/syck.c (syck_free_parser): fix memory leak by * ext/syck/syck.c (syck_free_parser): fix memory leak by

7
proc.c
View File

@ -528,15 +528,18 @@ rb_proc_call(VALUE self, VALUE args)
VALUE VALUE
rb_proc_call_with_block(VALUE self, int argc, VALUE *argv, VALUE pass_procval) rb_proc_call_with_block(VALUE self, int argc, VALUE *argv, VALUE pass_procval)
{ {
rb_proc_t *proc, *pass_proc = 0; rb_proc_t *proc;
rb_block_t *block = 0;
GetProcPtr(self, proc); GetProcPtr(self, proc);
if (!NIL_P(pass_procval)) { if (!NIL_P(pass_procval)) {
rb_proc_t *pass_proc;
GetProcPtr(pass_procval, pass_proc); GetProcPtr(pass_procval, pass_proc);
block = &pass_proc->block;
} }
return vm_invoke_proc(GET_THREAD(), proc, proc->block.self, return vm_invoke_proc(GET_THREAD(), proc, proc->block.self,
argc, argv, (pass_proc ? &pass_proc->block : 0)); argc, argv, block);
} }
/* /*