[前][次][番号順一覧][スレッド一覧]

ruby-changes:46930

From: ko1 <ko1@a...>
Date: Thu, 8 Jun 2017 14:22:53 +0900 (JST)
Subject: [ruby-changes:46930] ko1:r59045 (trunk): vm_block_handler_verify() should not return any value.

ko1	2017-06-08 14:22:49 +0900 (Thu, 08 Jun 2017)

  New Revision: 59045

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59045

  Log:
    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.

  Modified files:
    trunk/eval_intern.h
    trunk/vm.c
    trunk/vm_core.h
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 59044)
+++ vm_core.h	(revision 59045)
@@ -1302,12 +1302,11 @@ vm_block_handler_type(VALUE block_handle https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1302
     }
 }
 
-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
Index: eval_intern.h
===================================================================
--- eval_intern.h	(revision 59044)
+++ eval_intern.h	(revision 59045)
@@ -7,7 +7,7 @@ https://github.com/ruby/ruby/blob/trunk/eval_intern.h#L7
 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 https://github.com/ruby/ruby/blob/trunk/eval_intern.h#L15
 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);
 }
Index: vm.c
===================================================================
--- vm.c	(revision 59044)
+++ vm.c	(revision 59045)
@@ -166,6 +166,7 @@ vm_passed_block_handler(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/vm.c#L166
 {
     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 https://github.com/ruby/ruby/blob/trunk/vm.c#L1070
 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_pr https://github.com/ruby/ruby/blob/trunk/vm.c#L1168
 		  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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]