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

ruby-changes:14009

From: nobu <ko1@a...>
Date: Tue, 17 Nov 2009 16:38:07 +0900 (JST)
Subject: [ruby-changes:14009] Ruby:r25818 (trunk): * insns.def (opt_case_dispatch): runtime value cannot be used as

nobu	2009-11-17 16:26:26 +0900 (Tue, 17 Nov 2009)

  New Revision: 25818

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

  Log:
    * insns.def (opt_case_dispatch): runtime value cannot be used as
      an element initializer.
    
    * vm_insnhelper.c (opt_case_dispatch_i): gets rid of type-punning
      calls.

  Modified files:
    trunk/ChangeLog
    trunk/insns.def
    trunk/vm_insnhelper.c

Index: insns.def
===================================================================
--- insns.def	(revision 25817)
+++ insns.def	(revision 25818)
@@ -1247,10 +1247,10 @@
 	}
     }
     else {
-	struct opt_case_dispatch_i_arg arg = {
-	    key, -1
-	};
+	struct opt_case_dispatch_i_arg arg;
 
+	arg.obj = key;
+	arg.label = -1;
 	st_foreach(RHASH_TBL(hash), opt_case_dispatch_i, (st_data_t)&arg);
 
 	if (arg.label != -1) {
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 25817)
+++ ChangeLog	(revision 25818)
@@ -1,3 +1,10 @@
+Tue Nov 17 16:26:24 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* insns.def (opt_case_dispatch): runtime value cannot be used as
+	  an element initializer.
+
+	* vm_insnhelper.c (opt_case_dispatch_i): gets rid of type-punning
+	  calls.
 Mon Nov 16 15:51:53 2009  Shugo Maeda  <shugo@r...>
 
 	* vm_insnhelper.c (vm_call_method): protected singleton methods of
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 25817)
+++ vm_insnhelper.c	(revision 25818)
@@ -1645,9 +1645,9 @@
 };
 
 static int
-opt_case_dispatch_i(st_data_t key, st_data_t data, void *p)
+opt_case_dispatch_i(st_data_t key, st_data_t data, st_data_t p)
 {
-    struct opt_case_dispatch_i_arg *arg = p;
+    struct opt_case_dispatch_i_arg *arg = (void *)p;
 
     if (RTEST(rb_funcall((VALUE)key, idEqq, 1, arg->obj))) {
 	arg->label = FIX2INT((VALUE)data);

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

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