ruby-changes:39292
From: nobu <ko1@a...>
Date: Sat, 25 Jul 2015 11:18:42 +0900 (JST)
Subject: [ruby-changes:39292] nobu:r51373 (trunk): iseq.c: fix type
nobu 2015-07-25 11:18:32 +0900 (Sat, 25 Jul 2015) New Revision: 51373 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51373 Log: iseq.c: fix type * iseq.c (rb_iseq_disasm, iseq_data_to_ary): fix loop counter type for array length. Modified files: trunk/iseq.c Index: iseq.c =================================================================== --- iseq.c (revision 51372) +++ iseq.c (revision 51373) @@ -1461,8 +1461,8 @@ rb_iseq_disasm(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1461 n += rb_iseq_disasm_insn(str, code, n, iseq, child); } - for (i = 0; i < RARRAY_LEN(child); i++) { - VALUE isv = rb_ary_entry(child, i); + for (l = 0; l < RARRAY_LEN(child); l++) { + VALUE isv = rb_ary_entry(child, l); rb_str_concat(str, rb_iseq_disasm((rb_iseq_t *)isv)); } @@ -1663,7 +1663,8 @@ cdhash_each(VALUE key, VALUE value, VALU https://github.com/ruby/ruby/blob/trunk/iseq.c#L1663 static VALUE iseq_data_to_ary(const rb_iseq_t *iseq) { - long i; + unsigned int i; + long l; size_t ti; unsigned int pos; unsigned int line = 0; @@ -1916,8 +1917,8 @@ iseq_data_to_ary(const rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1917 body = rb_ary_new(); ti = 0; - for (i=0, pos=0; i<RARRAY_LEN(nbody); i++) { - VALUE ary = RARRAY_AREF(nbody, i); + for (l=0, pos=0; l<RARRAY_LEN(nbody); l++) { + VALUE ary = RARRAY_AREF(nbody, l); st_data_t label; if (st_lookup(labels_table, pos, &label)) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/