ruby-changes:39244
From: ko1 <ko1@a...>
Date: Wed, 22 Jul 2015 06:41:19 +0900 (JST)
Subject: [ruby-changes:39244] ko1:r51325 (trunk): * vm_core.h: constify rb_call_info_t::kw_arg,
ko1 2015-07-22 06:41:04 +0900 (Wed, 22 Jul 2015) New Revision: 51325 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51325 Log: * vm_core.h: constify rb_call_info_t::kw_arg, rb_control_frame_t::iseq and rb_control_frame_t::block_iseq. * iseq.c (iseq_free): catch up this fix. * vm.c: ditto. * vm_dump.c: ditto. Modified files: trunk/ChangeLog trunk/iseq.c trunk/vm.c trunk/vm_core.h trunk/vm_dump.c Index: ChangeLog =================================================================== --- ChangeLog (revision 51324) +++ ChangeLog (revision 51325) @@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Jul 22 06:37:54 2015 Koichi Sasada <ko1@a...> + + * vm_core.h: constify rb_call_info_t::kw_arg, + rb_control_frame_t::iseq and rb_control_frame_t::block_iseq. + + * iseq.c (iseq_free): catch up this fix. + + * vm.c: ditto. + + * vm_dump.c: ditto. + Wed Jul 22 06:25:45 2015 Koichi Sasada <ko1@a...> * vm_core.h: constify rb_call_info_t::blockiseq and rb_block_::iseq. Index: vm_core.h =================================================================== --- vm_core.h (revision 51324) +++ vm_core.h (revision 51325) @@ -202,7 +202,7 @@ typedef struct rb_call_info_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L202 unsigned int flag; int orig_argc; const rb_iseq_t *blockiseq; - rb_call_info_kw_arg_t *kw_arg; + const rb_call_info_kw_arg_t *kw_arg; /* inline cache: keys */ rb_serial_t method_state; @@ -550,11 +550,11 @@ typedef struct rb_vm_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L550 typedef struct rb_control_frame_struct { VALUE *pc; /* cfp[0] */ VALUE *sp; /* cfp[1] */ - rb_iseq_t *iseq; /* cfp[2] */ + const rb_iseq_t *iseq; /* cfp[2] */ VALUE flag; /* cfp[3] */ VALUE self; /* cfp[4] / block[0] */ VALUE *ep; /* cfp[5] / block[1] */ - rb_iseq_t *block_iseq; /* cfp[6] / block[2] */ + const rb_iseq_t *block_iseq;/* cfp[6] / block[2] */ VALUE proc; /* cfp[7] / block[3] */ #if VM_DEBUG_BP_CHECK Index: iseq.c =================================================================== --- iseq.c (revision 51324) +++ iseq.c (revision 51325) @@ -80,8 +80,8 @@ iseq_free(void *ptr) https://github.com/ruby/ruby/blob/trunk/iseq.c#L80 if (iseq->callinfo_entries) { for (i=0; i<iseq->callinfo_size; i++) { /* TODO: revisit callinfo data structure */ - rb_call_info_kw_arg_t *kw_arg = iseq->callinfo_entries[i].kw_arg; - ruby_xfree(kw_arg); + const rb_call_info_kw_arg_t *kw_arg = iseq->callinfo_entries[i].kw_arg; + ruby_xfree((void *)kw_arg); } ruby_xfree(iseq->callinfo_entries); } Index: vm.c =================================================================== --- vm.c (revision 51324) +++ vm.c (revision 51325) @@ -1767,7 +1767,7 @@ rb_thread_current_status(const rb_thread https://github.com/ruby/ruby/blob/trunk/vm.c#L1767 if (cfp->iseq != 0) { if (cfp->pc != 0) { - rb_iseq_t *iseq = cfp->iseq; + const rb_iseq_t *iseq = cfp->iseq; int line_no = rb_vm_get_sourceline(cfp); str = rb_sprintf("%"PRIsVALUE":%d:in `%"PRIsVALUE"'", iseq->location.path, line_no, iseq->location.label); @@ -2065,7 +2065,7 @@ rb_thread_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/vm.c#L2065 rb_gc_mark_values((long)(sp - p), p); while (cfp != limit_cfp) { - rb_iseq_t *iseq = cfp->iseq; + const rb_iseq_t *iseq = cfp->iseq; rb_gc_mark(cfp->proc); rb_gc_mark(cfp->self); if (iseq) { Index: vm_dump.c =================================================================== --- vm_dump.c (revision 51324) +++ vm_dump.c (revision 51325) @@ -358,7 +358,7 @@ rb_vmdebug_thread_dump_regs(VALUE thval) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L358 void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp,VALUE *_pc) { - rb_iseq_t *iseq = cfp->iseq; + const rb_iseq_t *iseq = cfp->iseq; if (iseq != 0) { ptrdiff_t pc = _pc - iseq->iseq_encoded; @@ -372,7 +372,7 @@ rb_vmdebug_debug_print_pre(rb_thread_t * https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L372 /* printf("%3"PRIdPTRDIFF" ", VM_CFP_CNT(th, cfp)); */ if (pc >= 0) { - const VALUE *iseq_original = rb_iseq_original_iseq(iseq); + const VALUE *iseq_original = rb_iseq_original_iseq((rb_iseq_t *)iseq); rb_iseq_disasm_insn(0, iseq_original, (size_t)pc, iseq, 0); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/