[前][次][番号順一覧][スレッド一覧]

ruby-changes:39241

From: ko1 <ko1@a...>
Date: Wed, 22 Jul 2015 06:19:27 +0900 (JST)
Subject: [ruby-changes:39241] ko1:r51322 (trunk): * method.h: constify rb_method_iseq_t::iseqptr.

ko1	2015-07-22 06:19:02 +0900 (Wed, 22 Jul 2015)

  New Revision: 51322

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51322

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/method.h
    trunk/proc.c
    trunk/vm_insnhelper.c
Index: method.h
===================================================================
--- method.h	(revision 51321)
+++ method.h	(revision 51322)
@@ -121,7 +121,7 @@ typedef enum { https://github.com/ruby/ruby/blob/trunk/method.h#L121
 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 */
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51321)
+++ ChangeLog	(revision 51322)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul 22 06:17:35 2015  Koichi Sasada  <ko1@a...>
+
+	* 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@a...>
 
 	* gc.c (internal_object_p): Now a singleton classes appear by
Index: proc.c
===================================================================
--- proc.c	(revision 51321)
+++ proc.c	(revision 51322)
@@ -2056,7 +2056,7 @@ rb_method_entry_min_max_arity(const rb_m https://github.com/ruby/ruby/blob/trunk/proc.c#L2056
       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:
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 51321)
+++ vm_insnhelper.c	(revision 51322)
@@ -1331,7 +1331,7 @@ vm_callee_setup_arg(rb_thread_t *th, rb_ https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1331
     }
 }
 
-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 *t https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1364
     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 https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1386
     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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]