diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | iseq.c | 9 | ||||
-rw-r--r-- | vm.c | 2 | ||||
-rw-r--r-- | vm_core.h | 4 | ||||
-rw-r--r-- | vm_insnhelper.c | 4 |
5 files changed, 19 insertions, 10 deletions
@@ -1,3 +1,13 @@ +Wed Jul 22 06:25:45 2015 Koichi Sasada <ko1@atdot.net> + + * 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@atdot.net> * method.h: constify rb_method_iseq_t::iseqptr. @@ -934,8 +934,7 @@ rb_iseq_method_name(VALUE self) } } -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, VALUE ary) } 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) } /* 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) 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); @@ -769,7 +769,7 @@ rb_binding_add_dynavars(rb_binding_t *bind, int dyncount, const ID *dynvars) 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; @@ -201,7 +201,7 @@ typedef struct rb_call_info_struct { 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 { 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; diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 6b1abff8c5..b3ff4fd0bc 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -2305,7 +2305,7 @@ static VALUE 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_control_frame_t *reg_cfp, rb_call_info_t *ci } 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(); |