From 2108e55c0b8fd31cec8968868a56876a22f3104c Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 23 Jun 2017 07:25:52 +0000 Subject: use "enum ruby_tag_type" and TAG_NONE. Return value of EXEC_TAG() is saved by "int state". Instead of "int", use "enum ruby_tag_type". First EXEC_TAG() value should be 0, so that define TAG_NONE (= 0) and use it. Some code used "status" instead of "state". To make them clear, rename them to state. We can change variable name from "state" to "tag_state", but this ticket doesn't contain it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'vm.c') diff --git a/vm.c b/vm.c index 10c9abc5b0..a41f175362 100644 --- a/vm.c +++ b/vm.c @@ -1138,11 +1138,11 @@ vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, VALUE passed_block_handler) { VALUE val = Qundef; - int state; + enum ruby_tag_type state; volatile int stored_safe = th->safe_level; TH_PUSH_TAG(th); - if ((state = EXEC_TAG()) == 0) { + if ((state = EXEC_TAG()) == TAG_NONE) { th->safe_level = proc->safe_level; val = invoke_block_from_c_proc(th, proc, self, argc, argv, passed_block_handler, proc->is_lambda); } @@ -1777,19 +1777,19 @@ hook_before_rewind(rb_thread_t *th, const rb_control_frame_t *cfp, int will_fini static VALUE vm_exec(rb_thread_t *th) { - int state; + enum ruby_tag_type state; VALUE result; VALUE initial = 0; struct vm_throw_data *err; TH_PUSH_TAG(th); _tag.retval = Qnil; - if ((state = EXEC_TAG()) == 0) { + if ((state = EXEC_TAG()) == TAG_NONE) { vm_loop_start: result = vm_exec_core(th, initial); - if ((state = th->state) != 0) { + if ((state = th->state) != TAG_NONE) { err = (struct vm_throw_data *)result; - th->state = 0; + th->state = TAG_NONE; goto exception_handler; } } @@ -1939,7 +1939,7 @@ vm_exec(rb_thread_t *th) #endif } th->errinfo = Qnil; - th->state = 0; + th->state = TAG_NONE; goto vm_loop_start; } } @@ -1989,7 +1989,7 @@ vm_exec(rb_thread_t *th) catch_iseq->body->stack_max); state = 0; - th->state = 0; + th->state = TAG_NONE; th->errinfo = Qnil; goto vm_loop_start; } -- cgit v1.2.3