summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-09-20 21:06:07 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-09-20 21:06:08 +0900
commit6e0dd3e7c1786e33c3193d0b4dd9579655c4e842 (patch)
tree13f33ad6576cf79bda2dc5473ad4913aded4438c
parent740a98fe108305324a66edb16f0acb8521a53da7 (diff)
Use RUBY_VM_NEXT_CONTROL_FRAME macro
in vm_push_frame and limit scope of i. Just a minor maintainability improvement.
-rw-r--r--vm_insnhelper.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index bea8d10037..56767a4a62 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -269,8 +269,7 @@ vm_push_frame(rb_execution_context_t *ec,
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,
/* setup vm value stack */
/* initialize local variables */
- for (i=0; i < local_size; i++) {
+ for (int i=0; i < local_size; i++) {
*sp++ = Qnil;
}