summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-13 09:10:40 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-13 09:10:40 (GMT)
commit2a754a733045da9965e88d1f31e650ea6b3f2b6c (patch)
tree4efdda77eca0999f3a35a2ec20002432af2e265b /vm.c
parent787b98e365e597e1ba8e9ec9b53fecb7f03688eb (diff)
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
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 017437b..92bc666 100644
--- a/vm.c
+++ b/vm.c
@@ -663,6 +663,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) {