From d6f88878f8b07c403ca6f8d644c4332173adbd0a Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 8 Jun 2017 05:22:49 +0000 Subject: vm_block_handler_verify() should not return any value. * vm_core.h (vm_block_handler_verify): this function only checks the given block handler with VM_ASSERT(). No need to return any value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval_intern.h | 4 ++-- vm.c | 5 +++-- vm_core.h | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eval_intern.h b/eval_intern.h index ed6ec47ae6..399faf3f90 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -7,7 +7,7 @@ static inline void vm_passed_block_handler_set(rb_thread_t *th, VALUE block_handler) { - VM_ASSERT(vm_block_handler_verify(block_handler)); + vm_block_handler_verify(block_handler); th->passed_block_handler = block_handler; } @@ -15,7 +15,7 @@ static inline void pass_passed_block_handler(rb_thread_t *th) { VALUE block_handler = rb_vm_frame_block_handler(th->ec.cfp); - VM_ASSERT(vm_block_handler_verify(block_handler)); + vm_block_handler_verify(block_handler); vm_passed_block_handler_set(th, block_handler); VM_ENV_FLAGS_SET(th->ec.cfp->ep, VM_FRAME_FLAG_PASSED); } diff --git a/vm.c b/vm.c index 33be0723fa..16524181be 100644 --- a/vm.c +++ b/vm.c @@ -166,6 +166,7 @@ vm_passed_block_handler(rb_thread_t *th) { VALUE block_handler = th->passed_block_handler; th->passed_block_handler = VM_BLOCK_HANDLER_NONE; + vm_block_handler_verify(block_handler); return block_handler; } @@ -1069,7 +1070,7 @@ static inline VALUE check_block_handler(rb_thread_t *th) { VALUE block_handler = VM_CF_BLOCK_HANDLER(th->ec.cfp); - VM_ASSERT(vm_block_handler_verify(block_handler)); + vm_block_handler_verify(block_handler); if (UNLIKELY(block_handler == VM_BLOCK_HANDLER_NONE)) { rb_vm_localjump_error("no block given", Qnil, 0); } @@ -1167,7 +1168,7 @@ rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, int argc, const VALUE *argv, VALUE passed_block_handler) { VALUE self = vm_block_self(&proc->block); - VM_ASSERT(vm_block_handler_verify(passed_block_handler)); + vm_block_handler_verify(passed_block_handler); if (proc->is_from_method) { return vm_invoke_bmethod(th, proc, self, argc, argv, passed_block_handler); diff --git a/vm_core.h b/vm_core.h index a55942e290..52d1bbcdce 100644 --- a/vm_core.h +++ b/vm_core.h @@ -1302,12 +1302,11 @@ vm_block_handler_type(VALUE block_handler) } } -static inline int +static inline void vm_block_handler_verify(VALUE block_handler) { VM_ASSERT(block_handler == VM_BLOCK_HANDLER_NONE || (vm_block_handler_type(block_handler), 1)); - return 1; } static inline enum rb_block_type -- cgit v1.2.3