diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-31 08:07:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-31 08:07:58 +0000 |
commit | 40bfdc7ce72407cec6cdeb91ac372202b23ad77a (patch) | |
tree | d64ee6e1a3f23ed5d2ed1d0a654163677152d5e8 /vm.c | |
parent | 3a2a302ce5d5455d90d55748ec8ed1a00df07537 (diff) | |
download | ruby-40bfdc7ce72407cec6cdeb91ac372202b23ad77a.tar.gz |
vm.c: fix return in lambda
* vm.c (invoke_block_from_c_splattable): pass lambda-ness.
* vm_eval.c (yield_under): invoke lambda proc properly.
[ruby-core:78917] [Bug #13090]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1021,9 +1021,9 @@ invoke_iseq_block_from_c(rb_thread_t *th, const struct rb_captured_block *captur static inline VALUE invoke_block_from_c_splattable(rb_thread_t *th, VALUE block_handler, int argc, const VALUE *argv, - VALUE passed_block_handler, const rb_cref_t *cref) + VALUE passed_block_handler, const rb_cref_t *cref, + int is_lambda) { - int is_lambda = FALSE; again: switch (vm_block_handler_type(block_handler)) { case block_handler_type_iseq: @@ -1058,21 +1058,21 @@ check_block_handler(rb_thread_t *th) } static VALUE -vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref) +vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref, int is_lambda) { - return invoke_block_from_c_splattable(th, check_block_handler(th), argc, argv, VM_BLOCK_HANDLER_NONE, cref); + return invoke_block_from_c_splattable(th, check_block_handler(th), argc, argv, VM_BLOCK_HANDLER_NONE, cref, is_lambda); } static VALUE vm_yield(rb_thread_t *th, int argc, const VALUE *argv) { - return invoke_block_from_c_splattable(th, check_block_handler(th), argc, argv, VM_BLOCK_HANDLER_NONE, NULL); + return invoke_block_from_c_splattable(th, check_block_handler(th), argc, argv, VM_BLOCK_HANDLER_NONE, NULL, FALSE); } static VALUE vm_yield_with_block(rb_thread_t *th, int argc, const VALUE *argv, VALUE block_handler) { - return invoke_block_from_c_splattable(th, check_block_handler(th), argc, argv, block_handler, NULL); + return invoke_block_from_c_splattable(th, check_block_handler(th), argc, argv, block_handler, NULL, FALSE); } static inline VALUE |