ruby-changes:38026
From: nobu <ko1@a...>
Date: Sat, 28 Mar 2015 14:23:33 +0900 (JST)
Subject: [ruby-changes:38026] nobu:r50107 (trunk): vm_eval.c: suppress warnings
nobu 2015-03-28 14:22:12 +0900 (Sat, 28 Mar 2015) New Revision: 50107 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50107 Log: vm_eval.c: suppress warnings * vm_eval.c (iterate_method): split to suppress false warnings by gcc 4.4. Modified files: trunk/vm_eval.c Index: vm_eval.c =================================================================== --- vm_eval.c (revision 50106) +++ vm_eval.c (revision 50107) @@ -1099,32 +1099,28 @@ static const char * https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1099 vm_frametype_name(const rb_control_frame_t *cfp); #endif -VALUE -rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1, - VALUE (* bl_proc) (ANYARGS), VALUE data2) +static VALUE +rb_iterate0(VALUE (* it_proc) (VALUE), VALUE data1, + const struct vm_ifunc *const ifunc, + rb_thread_t *const th) { int state; volatile VALUE retval = Qnil; - struct vm_ifunc *ifunc = bl_proc ? - IFUNC_NEW(bl_proc, data2, rb_frame_this_func()) : 0; - rb_thread_t *th = GET_THREAD(); - rb_control_frame_t *volatile cfp = th->cfp; + rb_control_frame_t *const cfp = th->cfp; TH_PUSH_TAG(th); state = TH_EXEC_TAG(); if (state == 0) { - VAR_INITIALIZED(th); - VAR_INITIALIZED(ifunc); iter_retry: { rb_block_t *blockptr; - if (bl_proc) { - blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(th->cfp); + if (ifunc) { + blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp); blockptr->iseq = (void *)ifunc; blockptr->proc = 0; } else { - blockptr = VM_CF_BLOCK_PTR(th->cfp); + blockptr = VM_CF_BLOCK_PTR(cfp); } th->passed_block = blockptr; } @@ -1156,6 +1152,15 @@ rb_iterate(VALUE (* it_proc) (VALUE), VA https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1152 return retval; } +VALUE +rb_iterate(VALUE (* it_proc)(VALUE), VALUE data1, + VALUE (* bl_proc)(ANYARGS), VALUE data2) +{ + return rb_iterate0(it_proc, data1, + bl_proc ? IFUNC_NEW(bl_proc, data2, rb_frame_this_func()) : 0, + GET_THREAD()); +} + struct iter_method_arg { VALUE obj; ID mid; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/