ruby-changes:57841
From: Takashi <ko1@a...>
Date: Fri, 20 Sep 2019 21:08:35 +0900 (JST)
Subject: [ruby-changes:57841] 6e0dd3e7c1 (master): Use RUBY_VM_NEXT_CONTROL_FRAME macro
https://git.ruby-lang.org/ruby.git/commit/?id=6e0dd3e7c1 From 6e0dd3e7c1786e33c3193d0b4dd9579655c4e842 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Fri, 20 Sep 2019 21:06:07 +0900 Subject: Use RUBY_VM_NEXT_CONTROL_FRAME macro in vm_push_frame and limit scope of i. Just a minor maintainability improvement. diff --git a/vm_insnhelper.c b/vm_insnhelper.c index bea8d10..56767a4 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -269,8 +269,7 @@ vm_push_frame(rb_execution_context_t *ec, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L269 int local_size, int stack_max) { - rb_control_frame_t *const cfp = ec->cfp - 1; - int i; + rb_control_frame_t *const cfp = RUBY_VM_NEXT_CONTROL_FRAME(ec->cfp); vm_check_frame(type, specval, cref_or_me, iseq); VM_ASSERT(local_size >= 0); @@ -290,7 +289,7 @@ vm_push_frame(rb_execution_context_t *ec, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L289 /* setup vm value stack */ /* initialize local variables */ - for (i=0; i < local_size; i++) { + for (int i=0; i < local_size; i++) { *sp++ = Qnil; } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/