зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
c5618920ed
Коммит
948bd807c3
10
ChangeLog
10
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.
|
||||
|
|
9
iseq.c
9
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);
|
||||
|
|
2
vm.c
2
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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче