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

ruby-changes:6040

From: mame <ko1@a...>
Date: Tue, 24 Jun 2008 00:23:31 +0900 (JST)
Subject: [ruby-changes:6040] Ruby:r17550 (trunk): * compile.c (iseq_build_from_ary): initialize arg_opts, a patch from

mame	2008-06-24 00:23:12 +0900 (Tue, 24 Jun 2008)

  New Revision: 17550

  Modified files:
    trunk/ChangeLog
    trunk/compile.c

  Log:
    * compile.c (iseq_build_from_ary): initialize arg_opts, a patch from
      Adam Strzelecki <ono@j...> in [ruby-core:17220].


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/compile.c?r1=17550&r2=17549&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17550&r2=17549&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 17549)
+++ ChangeLog	(revision 17550)
@@ -1,3 +1,8 @@
+Tue Jun 24 00:21:53 2008  Yusuke Endoh  <mame@t...>
+
+	* compile.c (iseq_build_from_ary): initialize arg_opts, a patch from
+	  Adam Strzelecki <ono@j...> in [ruby-core:17220].
+
 Tue Jun 24 00:10:53 2008  wanabe  <s.wanabe@g...>
 	* compile.c (iseq_build_from_ary): fix expression to obtain 
 	  iseq->local_size and iseq->local_table_size.  [ruby-dev:35205]
Index: compile.c
===================================================================
--- compile.c	(revision 17549)
+++ compile.c	(revision 17550)
@@ -5019,7 +5019,8 @@
 	iseq->arg_post_len = FIX2INT(arg_post_len);
 	iseq->arg_post_start = FIX2INT(arg_post_start);
 	iseq->arg_block = FIX2INT(arg_block);
-	iseq->arg_opt_table = (VALUE *)ALLOC_N(VALUE, RARRAY_LEN(arg_opt_labels));
+	iseq->arg_opts = RARRAY_LEN(arg_opt_labels);
+	iseq->arg_opt_table = (VALUE *)ALLOC_N(VALUE, iseq->arg_opts);
 
 	if (iseq->arg_block != -1) {
 	    iseq->arg_size = iseq->arg_block + 1;
@@ -5031,7 +5032,7 @@
 	    iseq->arg_size = iseq->arg_rest + 1;
 	}
 	else {
-	    iseq->arg_size = iseq->argc + iseq->arg_opts;
+	    iseq->arg_size = iseq->argc + (iseq->arg_opts ? iseq->arg_opts - 1 : 0);
 	}
 
 	for (i=0; i<RARRAY_LEN(arg_opt_labels); i++) {

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

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