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

ruby-changes:10381

From: nobu <ko1@a...>
Date: Sun, 1 Feb 2009 05:40:49 +0900 (JST)
Subject: [ruby-changes:10381] Ruby:r21925 (trunk): * variable.c (rb_const_get_0), vm_insnhelper.c (vm_get_ev_const):

nobu	2009-02-01 05:19:44 +0900 (Sun, 01 Feb 2009)

  New Revision: 21925

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

  Log:
    * variable.c (rb_const_get_0), vm_insnhelper.c (vm_get_ev_const):
      avoids infinite self recursion autoload.  [ruby-core:21696]

  Modified files:
    trunk/ChangeLog
    trunk/bootstraptest/test_autoload.rb
    trunk/variable.c
    trunk/version.h
    trunk/vm_insnhelper.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 21924)
+++ ChangeLog	(revision 21925)
@@ -1,3 +1,8 @@
+Sun Feb  1 05:19:43 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* variable.c (rb_const_get_0), vm_insnhelper.c (vm_get_ev_const):
+	  avoids infinite self recursion autoload.  [ruby-core:21696]
+
 Sat Jan 31 22:50:38 2009  Tanaka Akira  <akr@f...>
 
 	* lib/test/unit/assertions.rb (assert_equal): show class in failure
Index: variable.c
===================================================================
--- variable.c	(revision 21924)
+++ variable.c	(revision 21925)
@@ -1470,8 +1470,11 @@
     tmp = klass;
   retry:
     while (RTEST(tmp)) {
+	VALUE am = 0;
 	while (RCLASS_IV_TBL(tmp) && st_lookup(RCLASS_IV_TBL(tmp),id,&value)) {
 	    if (value == Qundef) {
+		if (am == tmp) break;
+		am = tmp;
 		rb_autoload_load(tmp, id);
 		continue;
 	    }
Index: bootstraptest/test_autoload.rb
===================================================================
--- bootstraptest/test_autoload.rb	(revision 21924)
+++ bootstraptest/test_autoload.rb	(revision 21925)
@@ -59,3 +59,11 @@
   [t1.value, t2.value].join
 }
 
+assert_finish 5, %q{
+  autoload :ZZZ, File.expand_path(__FILE__)
+  begin
+    ZZZ
+  rescue NameError
+  end
+}, '[ruby-core:21696]'
+
Index: version.h
===================================================================
--- version.h	(revision 21924)
+++ version.h	(revision 21925)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.1"
-#define RUBY_RELEASE_DATE "2009-01-31"
+#define RUBY_RELEASE_DATE "2009-02-01"
 #define RUBY_PATCHLEVEL 5000
 #define RUBY_BRANCH_NAME "trunk"
 
@@ -7,8 +7,8 @@
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
 #define RUBY_RELEASE_YEAR 2009
-#define RUBY_RELEASE_MONTH 1
-#define RUBY_RELEASE_DAY 31
+#define RUBY_RELEASE_MONTH 2
+#define RUBY_RELEASE_DAY 1
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 21924)
+++ vm_insnhelper.c	(revision 21925)
@@ -1082,10 +1082,13 @@
 	    cref = cref->nd_next;
 
 	    if (!NIL_P(klass)) {
+		VALUE am = 0;
 	      search_continue:
 		if (RCLASS_IV_TBL(klass) &&
 		    st_lookup(RCLASS_IV_TBL(klass), id, &val)) {
 		    if (val == Qundef) {
+			if (am == klass) break;
+			am = klass;
 			rb_autoload_load(klass, id);
 			goto search_continue;
 		    }

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

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