summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 08:06:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 08:06:19 +0000
commit92b4a05e07de480fabc70dae35c4b6dd2b1f42c9 (patch)
tree599d822117e67be4b0bcc5be81595147591e2cf3 /vm.c
parent58553ca18487083d8a7f72068545e75788e1c8bc (diff)
vm_eval.c: rb_yield_block
* vm_eval.c (rb_yield_block): yield block with rb_block_call_func arguments. * range.c (range_each): use rb_yield_block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index 5acdf2b..7b3447f 100644
--- a/vm.c
+++ b/vm.c
@@ -699,6 +699,14 @@ vm_yield(rb_thread_t *th, int argc, const VALUE *argv)
blockptr->klass);
}
+static inline VALUE
+vm_yield_with_block(rb_thread_t *th, int argc, const VALUE *argv, const rb_block_t *blockargptr)
+{
+ const rb_block_t *blockptr = check_block(th);
+ return invoke_block_from_c(th, blockptr, blockptr->self, argc, argv, blockargptr, 0,
+ blockptr->klass);
+}
+
static VALUE
vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self, VALUE defined_class,
int argc, const VALUE *argv, const rb_block_t *blockptr)