From 22be6d06ab60ac22fbaa1cf29afa048a456d4319 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 24 Jul 2015 21:44:14 +0000 Subject: * vm_core.h: size should be unsigned. * rb_call_info_t::index * rb_iseq_constant_body::stack_max * rb_iseq_constant_body::local_size * rb_iseq_constant_body::param::size * rb_iseq_constant_body::local_table_size * rb_iseq_constant_body::is_size * rb_iseq_constant_body::callinfo_size * iseq.h: same for iseq_catch_table::size. * compile.c: catch up these fix. * iseq.c: ditto. * proc.c: ditto. * vm.c: ditto. * vm_args.c: ditto. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 28ab876000..637f56ffff 100644 --- a/compile.c +++ b/compile.c @@ -1080,11 +1080,11 @@ get_lvar_level(const rb_iseq_t *iseq) static int get_dyna_var_idx_at_raw(const rb_iseq_t *iseq, ID id) { - int i; + unsigned int i; for (i = 0; i < iseq->body->local_table_size; i++) { if (iseq->body->local_table[i] == id) { - return i; + return (int)i; } } return -1; @@ -1587,7 +1587,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) } case TS_IC: /* inline cache */ { - int ic_index = FIX2INT(operands[j]); + unsigned int ic_index = FIX2UINT(operands[j]); IC ic = (IC)&iseq->body->is_entries[ic_index]; if (UNLIKELY(ic_index >= iseq->body->is_size)) { rb_bug("iseq_set_sequence: ic_index overflow: index: %d, size: %d", ic_index, iseq->body->is_size); @@ -1719,7 +1719,7 @@ static int iseq_set_exception_table(rb_iseq_t *iseq) { const VALUE *tptr, *ptr; - int tlen, i; + unsigned int tlen, i; struct iseq_catch_table_entry *entry; tlen = (int)RARRAY_LEN(iseq->compile_data->catch_table_ary); @@ -6013,7 +6013,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *anchor, break; case TS_IC: argv[j] = op; - if (NUM2INT(op) >= iseq->body->is_size) { + if (NUM2UINT(op) >= iseq->body->is_size) { iseq->body->is_size = NUM2INT(op) + 1; } break; @@ -6274,7 +6274,7 @@ rb_dvar_defined(ID id) iseq->body->type == ISEQ_TYPE_EVAL || iseq->body->type == ISEQ_TYPE_MAIN ) { - int i; + unsigned int i; for (i = 0; i < iseq->body->local_table_size; i++) { if (iseq->body->local_table[i] == id) { @@ -6294,7 +6294,7 @@ rb_local_defined(ID id) const rb_iseq_t *iseq; if (th->base_block && th->base_block->iseq) { - int i; + unsigned int i; iseq = th->base_block->iseq->body->local_iseq; for (i=0; ibody->local_table_size; i++) { -- cgit v1.2.3