ruby-changes:39242
From: ko1 <ko1@a...>
Date: Wed, 22 Jul 2015 06:29:32 +0900 (JST)
Subject: [ruby-changes:39242] ko1:r51323 (trunk): * vm_core.h: constify rb_call_info_t::blockiseq and rb_iseq_t::iseq.
ko1 2015-07-22 06:28:43 +0900 (Wed, 22 Jul 2015) New Revision: 51323 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51323 Log: * vm_core.h: constify rb_call_info_t::blockiseq and rb_iseq_t::iseq. * vm.c, vm_insnhelper.c: catch up this fix. * iseq.c (iseq_data_to_ary): constify the first iseq parameter. * vm_insnhelper.c (vm_make_proc_with_iseq): ditto. Modified files: trunk/ChangeLog trunk/iseq.c trunk/vm.c trunk/vm_core.h trunk/vm_insnhelper.c Index: ChangeLog =================================================================== --- ChangeLog (revision 51322) +++ ChangeLog (revision 51323) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Jul 22 06:25:45 2015 Koichi Sasada <ko1@a...> + + * vm_core.h: constify rb_call_info_t::blockiseq and rb_iseq_t::iseq. + + * vm.c, vm_insnhelper.c: catch up this fix. + + * iseq.c (iseq_data_to_ary): constify the first iseq parameter. + + * vm_insnhelper.c (vm_make_proc_with_iseq): ditto. + Wed Jul 22 06:17:35 2015 Koichi Sasada <ko1@a...> * method.h: constify rb_method_iseq_t::iseqptr. Index: vm_core.h =================================================================== --- vm_core.h (revision 51322) +++ vm_core.h (revision 51323) @@ -201,7 +201,7 @@ typedef struct rb_call_info_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L201 unsigned int flag; int orig_argc; - rb_iseq_t *blockiseq; + const rb_iseq_t *blockiseq; rb_call_info_kw_arg_t *kw_arg; /* inline cache: keys */ @@ -565,7 +565,7 @@ typedef struct rb_control_frame_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L565 typedef struct rb_block_struct { VALUE self; /* share with method frame if it's only block */ VALUE *ep; /* share with method frame if it's only block */ - rb_iseq_t *iseq; + const rb_iseq_t *iseq; VALUE proc; } rb_block_t; Index: iseq.c =================================================================== --- iseq.c (revision 51322) +++ iseq.c (revision 51323) @@ -934,8 +934,7 @@ rb_iseq_method_name(VALUE self) https://github.com/ruby/ruby/blob/trunk/iseq.c#L934 } } -static -VALUE iseq_data_to_ary(rb_iseq_t *iseq); +static VALUE iseq_data_to_ary(const rb_iseq_t *iseq); /* * call-seq: @@ -1611,7 +1610,7 @@ cdhash_each(VALUE key, VALUE value, VALU https://github.com/ruby/ruby/blob/trunk/iseq.c#L1610 } static VALUE -iseq_data_to_ary(rb_iseq_t *iseq) +iseq_data_to_ary(const rb_iseq_t *iseq) { long i; size_t ti; @@ -1731,7 +1730,7 @@ iseq_data_to_ary(rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1730 } /* body */ - iseq_original = rb_iseq_original_iseq(iseq); + iseq_original = rb_iseq_original_iseq((rb_iseq_t *)iseq); for (seq = iseq_original; seq < iseq_original + iseq->iseq_size; ) { VALUE insn = *seq++; @@ -1756,7 +1755,7 @@ iseq_data_to_ary(rb_iseq_t *iseq) https://github.com/ruby/ruby/blob/trunk/iseq.c#L1755 break; case TS_ISEQ: { - rb_iseq_t *iseq = (rb_iseq_t *)*seq; + const rb_iseq_t *iseq = (rb_iseq_t *)*seq; if (iseq) { VALUE val = iseq_data_to_ary(iseq); rb_ary_push(ary, val); Index: vm.c =================================================================== --- vm.c (revision 51322) +++ vm.c (revision 51323) @@ -769,7 +769,7 @@ rb_binding_add_dynavars(rb_binding_t *bi https://github.com/ruby/ruby/blob/trunk/vm.c#L769 rb_env_t *env; rb_block_t *base_block; rb_thread_t *th = GET_THREAD(); - rb_iseq_t *base_iseq; + const rb_iseq_t *base_iseq; NODE *node = 0; ID minibuf[4], *dyns = minibuf; VALUE idtmp = 0; Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 51322) +++ vm_insnhelper.c (revision 51323) @@ -2305,7 +2305,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2305 vm_invoke_block(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci) { const rb_block_t *block = VM_CF_BLOCK_PTR(reg_cfp); - rb_iseq_t *iseq; + const rb_iseq_t *iseq; VALUE type = GET_ISEQ()->local_iseq->type; if ((type != ISEQ_TYPE_METHOD && type != ISEQ_TYPE_CLASS) || block == 0) { @@ -2344,7 +2344,7 @@ vm_invoke_block(rb_thread_t *th, rb_cont https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2344 } static VALUE -vm_make_proc_with_iseq(rb_iseq_t *blockiseq) +vm_make_proc_with_iseq(const rb_iseq_t *blockiseq) { rb_block_t *blockptr; rb_thread_t *th = GET_THREAD(); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/