diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-05 06:57:20 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-05 06:57:20 +0000 |
commit | 424b4ffe300e2e10bd39df3dab24732d33b0df8b (patch) | |
tree | baa310e6a1b6e726cfba8b356f1fd9e383d2944a | |
parent | ff18933b72bbe2a232bb8a96877364e836dd8465 (diff) | |
download | ruby-424b4ffe300e2e10bd39df3dab24732d33b0df8b.tar.gz |
do not inform ``is_lambda".
* vm_eval.c (yield_under): do not inform Proc is lambda or not.
After that invoke_block_from_c_bh() checks it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | vm.c | 4 | ||||
-rw-r--r-- | vm_eval.c | 8 |
2 files changed, 5 insertions, 7 deletions
@@ -1078,11 +1078,11 @@ 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, int is_lambda) +vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref) { return invoke_block_from_c_bh(th, check_block_handler(th), argc, argv, VM_BLOCK_HANDLER_NONE, - cref, is_lambda, FALSE); + cref, FALSE, FALSE); } static VALUE @@ -16,7 +16,7 @@ struct local_var_list { }; static inline VALUE method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum method_missing_reason call_status); -static inline VALUE vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref, int is_lambda); +static inline VALUE vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref); static inline VALUE vm_yield(rb_thread_t *th, int argc, const VALUE *argv); static inline VALUE vm_yield_with_block(rb_thread_t *th, int argc, const VALUE *argv, VALUE block_handler); static inline VALUE vm_yield_force_blockarg(rb_thread_t *th, VALUE args); @@ -1573,7 +1573,6 @@ yield_under(VALUE under, VALUE self, int argc, const VALUE *argv) struct rb_captured_block new_captured; const VALUE *ep = NULL; rb_cref_t *cref; - int is_lambda = FALSE; if (block_handler != VM_BLOCK_HANDLER_NONE) { again: @@ -1589,7 +1588,6 @@ yield_under(VALUE under, VALUE self, int argc, const VALUE *argv) new_block_handler = VM_BH_FROM_IFUNC_BLOCK(&new_captured); break; case block_handler_type_proc: - is_lambda = rb_proc_lambda_p(block_handler) != Qfalse; block_handler = vm_proc_to_block_handler(VM_BH_TO_PROC(block_handler)); goto again; case block_handler_type_symbol: @@ -1604,7 +1602,7 @@ yield_under(VALUE under, VALUE self, int argc, const VALUE *argv) } cref = vm_cref_push(th, under, ep, TRUE); - return vm_yield_with_cref(th, argc, argv, cref, is_lambda); + return vm_yield_with_cref(th, argc, argv, cref); } VALUE @@ -1625,7 +1623,7 @@ rb_yield_refine_block(VALUE refinement, VALUE refinements) CREF_REFINEMENTS_SET(cref, refinements); VM_FORCE_WRITE_SPECIAL_CONST(&VM_CF_LEP(th->ec.cfp)[VM_ENV_DATA_INDEX_SPECVAL], new_block_handler); new_captured.self = refinement; - return vm_yield_with_cref(th, 0, NULL, cref, FALSE); + return vm_yield_with_cref(th, 0, NULL, cref); } } |