summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 21:41:04 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-21 21:41:04 (GMT)
commit331fb4a2b3576ee364dc67f212b3c9c759fafdd8 (patch)
tree2aa54ede5ceee09162d3216364f1b48b1aeb3afe
parent684c449c361ab8c29ddca6d7e9a77fb7ea82864c (diff)
* 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
-rw-r--r--ChangeLog11
-rw-r--r--iseq.c4
-rw-r--r--vm.c4
-rw-r--r--vm_core.h6
-rw-r--r--vm_dump.c4
5 files changed, 20 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index c862a81..8cc90b5 100644
--- a/ChangeLog
+++ b/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.
diff --git a/iseq.c b/iseq.c
index 694b3df..0161dea 100644
--- a/iseq.c
+++ b/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);
}
diff --git a/vm.c b/vm.c
index 41947a9..9aaf5f6 100644
--- a/vm.c
+++ b/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) {
diff --git a/vm_core.h b/vm_core.h
index daf801f..c0c119a 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -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
diff --git a/vm_dump.c b/vm_dump.c
index 599229b..dc27dd4 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -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);
}