зеркало из https://github.com/github/ruby.git
* insns.def (invokeblock): check block is created by lambda
or Proc.new. * vm.c (block_proc_is_lambda): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8ef2289a49
Коммит
203286673d
|
@ -1,3 +1,10 @@
|
|||
Tue Jun 5 14:07:55 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* insns.def (invokeblock): check block is created by lambda
|
||||
or Proc.new.
|
||||
|
||||
* vm.c (block_proc_is_lambda): added.
|
||||
|
||||
Tue Jun 5 14:47:52 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* lib/pp.rb (PP::PPMethods::seplist): revert last change to work
|
||||
|
|
|
@ -1238,7 +1238,7 @@ send
|
|||
id = ip->defined_method_id;
|
||||
|
||||
if (ip != ip->local_iseq) {
|
||||
/* defined by method_defined() */
|
||||
/* defined by Module#define_method() */
|
||||
rb_control_frame_t *lcfp = GET_CFP();
|
||||
|
||||
while (lcfp->iseq != ip) {
|
||||
|
@ -1345,7 +1345,8 @@ invokeblock
|
|||
}
|
||||
|
||||
INC_SP(-argc);
|
||||
argc = th_yield_setup_args(th, iseq, argc, GET_SP(), 0);
|
||||
argc = th_yield_setup_args(th, iseq, argc, GET_SP(),
|
||||
block_proc_is_lambda(block->proc));
|
||||
INC_SP(argc);
|
||||
|
||||
push_frame(th, iseq,
|
||||
|
|
15
vm.c
15
vm.c
|
@ -1351,6 +1351,21 @@ call_yarv_end_proc(VALUE data)
|
|||
rb_proc_call(data, rb_ary_new2(0));
|
||||
}
|
||||
|
||||
static inline int
|
||||
block_proc_is_lambda(VALUE procval)
|
||||
{
|
||||
rb_proc_t *proc;
|
||||
|
||||
if (procval) {
|
||||
GetProcPtr(procval, proc);
|
||||
return proc->is_lambda;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************/
|
||||
/*********************************************************/
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче