1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use RUBY_VM_NEXT_CONTROL_FRAME macro

in vm_push_frame and limit scope of i.
Just a minor maintainability improvement.
This commit is contained in:
Takashi Kokubun 2019-09-20 21:06:07 +09:00
parent 740a98fe10
commit 6e0dd3e7c1
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -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;
}