mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
684c449c36
commit
331fb4a2b3
5 changed files with 20 additions and 9 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
Wed Jul 22 06:37:54 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* 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@atdot.net>
|
||||
|
||||
* vm_core.h: constify rb_call_info_t::blockiseq and rb_block_::iseq.
|
||||
|
|
4
iseq.c
4
iseq.c
|
@ -80,8 +80,8 @@ iseq_free(void *ptr)
|
|||
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);
|
||||
}
|
||||
|
|
4
vm.c
4
vm.c
|
@ -1767,7 +1767,7 @@ rb_thread_current_status(const rb_thread_t *th)
|
|||
|
||||
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)
|
|||
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) {
|
||||
|
|
|
@ -202,7 +202,7 @@ typedef struct rb_call_info_struct {
|
|||
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 {
|
|||
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
|
||||
|
|
|
@ -358,7 +358,7 @@ rb_vmdebug_thread_dump_regs(VALUE thval)
|
|||
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 *th, rb_control_frame_t *cfp,VALUE *_pc)
|
|||
|
||||
/* 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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue