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

ruby-changes:34397

From: nobu <ko1@a...>
Date: Fri, 20 Jun 2014 15:59:34 +0900 (JST)
Subject: [ruby-changes:34397] nobu:r46478 (trunk): insns.def: avoid type-punned pointer cast

nobu	2014-06-20 15:59:28 +0900 (Fri, 20 Jun 2014)

  New Revision: 46478

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

  Log:
    insns.def: avoid type-punned pointer cast
    
    * insns.def (once), vm_insnhelper.c (vm_once_exec): turn the
      parameter into a VALUE to get rid of type-punned pointer cast.

  Modified files:
    trunk/insns.def
    trunk/vm_insnhelper.c
Index: insns.def
===================================================================
--- insns.def	(revision 46477)
+++ insns.def	(revision 46478)
@@ -1250,7 +1250,7 @@ once https://github.com/ruby/ruby/blob/trunk/insns.def#L1250
 	}
 	else if (is->once.running_thread == th) {
 	    /* recursive once */
-	    val = vm_once_exec(iseq);
+	    val = vm_once_exec((VALUE)iseq);
 	}
 	else {
 	    /* waiting for finish */
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 46477)
+++ vm_insnhelper.c	(revision 46478)
@@ -2397,9 +2397,9 @@ vm_make_proc_with_iseq(rb_iseq_t *blocki https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2397
 }
 
 static VALUE
-vm_once_exec(rb_iseq_t *iseq)
+vm_once_exec(VALUE iseq)
 {
-    VALUE proc = vm_make_proc_with_iseq(iseq);
+    VALUE proc = vm_make_proc_with_iseq((rb_iseq_t *)iseq);
     return rb_proc_call_with_block(proc, 0, 0, Qnil);
 }
 

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

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