summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--method.h2
-rw-r--r--proc.c2
-rw-r--r--vm_insnhelper.c6
4 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index fd85131..e6fb771 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Wed Jul 22 06:17:35 2015 Koichi Sasada <ko1@atdot.net>
+
+ * method.h: constify rb_method_iseq_t::iseqptr.
+
+ * proc.c (rb_method_entry_min_max_arity): catch up this fix.
+
+ * vm_insnhelper.c (def_iseq_ptr): constify.
+
Wed Jul 22 03:37:39 2015 Koichi Sasada <ko1@atdot.net>
* gc.c (internal_object_p): Now a singleton classes appear by
diff --git a/method.h b/method.h
index 1a409cc..c421d48 100644
--- a/method.h
+++ b/method.h
@@ -121,7 +121,7 @@ typedef enum {
typedef struct rb_iseq_struct rb_iseq_t;
typedef struct rb_method_iseq_struct {
- rb_iseq_t * const iseqptr; /* should be separated from iseqval */
+ const rb_iseq_t * const iseqptr; /* should be separated from iseqval */
rb_cref_t * const cref; /* shoudl be marked */
} rb_method_iseq_t; /* check rb_add_method_iseq() when modify the fields */
diff --git a/proc.c b/proc.c
index 76a004d..8cf652b 100644
--- a/proc.c
+++ b/proc.c
@@ -2056,7 +2056,7 @@ rb_method_entry_min_max_arity(const rb_method_entry_t *me, int *max)
case VM_METHOD_TYPE_BMETHOD:
return rb_proc_min_max_arity(def->body.proc, max);
case VM_METHOD_TYPE_ISEQ: {
- rb_iseq_t *iseq = def->body.iseq.iseqptr;
+ const rb_iseq_t *iseq = def->body.iseq.iseqptr;
return rb_iseq_min_max_arity(iseq, max);
}
case VM_METHOD_TYPE_UNDEF:
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 8e85174..6b1abff 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1331,7 +1331,7 @@ vm_callee_setup_arg(rb_thread_t *th, rb_call_info_t *ci, const rb_iseq_t *iseq,
}
}
-static rb_iseq_t *
+static const rb_iseq_t *
def_iseq_ptr(rb_method_definition_t *def)
{
#if VM_CHECK_MODE > 0
@@ -1364,7 +1364,7 @@ vm_call_iseq_setup_normal(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info
int i, local_size;
VALUE *argv = cfp->sp - ci->argc;
const rb_callable_method_entry_t *me = ci->me;
- rb_iseq_t *iseq = def_iseq_ptr(me->def);
+ const rb_iseq_t *iseq = def_iseq_ptr(me->def);
VALUE *sp = argv + iseq->param.size;
/* clear local variables (arg_size...local_size) */
@@ -1386,7 +1386,7 @@ vm_call_iseq_setup_tailcall(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_in
int i;
VALUE *argv = cfp->sp - ci->argc;
const rb_callable_method_entry_t *me = ci->me;
- rb_iseq_t *iseq = def_iseq_ptr(me->def);
+ const rb_iseq_t *iseq = def_iseq_ptr(me->def);
VALUE *src_argv = argv;
VALUE *sp_orig, *sp;
VALUE finish_flag = VM_FRAME_TYPE_FINISH_P(cfp) ? VM_FRAME_FLAG_FINISH : 0;