mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
proc.c: make lambda directly
* vm.c (rb_vm_make_proc_lambda): similar to rb_vm_make_proc() with is_lambda argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
787b98e365
commit
2a754a7330
4 changed files with 15 additions and 12 deletions
8
vm.c
8
vm.c
|
@ -662,6 +662,12 @@ rb_proc_alloc(VALUE klass, const rb_block_t *block,
|
|||
|
||||
VALUE
|
||||
rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass)
|
||||
{
|
||||
return rb_vm_make_proc_lambda(th, block, klass, 0);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_vm_make_proc_lambda(rb_thread_t *th, const rb_block_t *block, VALUE klass, int8_t is_lambda)
|
||||
{
|
||||
VALUE procval, envval, blockprocval = 0;
|
||||
rb_control_frame_t *cfp = RUBY_VM_GET_CFP_FROM_BLOCK_PTR(block);
|
||||
|
@ -677,7 +683,7 @@ rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass)
|
|||
}
|
||||
|
||||
procval = rb_proc_alloc(klass, block, envval, blockprocval,
|
||||
(int8_t)th->safe_level, 0, 0);
|
||||
(int8_t)th->safe_level, 0, is_lambda);
|
||||
|
||||
if (VMDEBUG) {
|
||||
if (th->stack < block->ep && block->ep < th->stack + th->stack_size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue