aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 21:28:43 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 21:28:43 +0000
commit948bd807c3c564317e1c2e8d66ecaf85c49dead7 (patch)
tree8d6c945cf4d7a4df45fd319613046ccab49f4b32
parentc5618920ed9cdfafc539a7b43f0911fbdff7bd19 (diff)
downloadruby-948bd807c3c564317e1c2e8d66ecaf85c49dead7.tar.gz
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--iseq.c9
-rw-r--r--vm.c2
-rw-r--r--vm_core.h4
-rw-r--r--vm_insnhelper.c4
5 files changed, 19 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index e6fb7717c3..a0c62cd515 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/iseq.c b/iseq.c
index 1af491e997..694b3dfe05 100644
--- a/iseq.c
+++ b/iseq.c
@@ -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);
diff --git a/vm.c b/vm.c
index bbd5320fc9..41947a97a2 100644
--- a/vm.c
+++ b/vm.c
@@ -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;
diff --git a/vm_core.h b/vm_core.h
index d032307269..daf801f21c 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -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();