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

ruby-changes:5292

From: knu <ko1@a...>
Date: Tue, 3 Jun 2008 19:55:31 +0900 (JST)
Subject: [ruby-changes:5292] Ruby:r16791 (ruby_1_8): * enumerator.c (enumerator_init_copy): Take care of

knu	2008-06-03 19:55:17 +0900 (Tue, 03 Jun 2008)

  New Revision: 16791

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/enumerator.c

  Log:
    * enumerator.c (enumerator_init_copy): Take care of
      initialize_copy as well as initialize.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16791&r2=16790&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/enumerator.c?r1=16791&r2=16790&diff_format=u

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 16790)
+++ ruby_1_8/ChangeLog	(revision 16791)
@@ -1,3 +1,8 @@
+Tue Jun  3 19:33:22 2008  Akinori MUSHA  <knu@i...>
+
+	* enumerator.c (enumerator_init_copy): Take care of
+	  initialize_copy as well as initialize.
+
 Tue Jun  3 16:06:09 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* file.c (file_expand_path): fix for non-existent files and SFN of
Index: ruby_1_8/enumerator.c
===================================================================
--- ruby_1_8/enumerator.c	(revision 16790)
+++ ruby_1_8/enumerator.c	(revision 16791)
@@ -293,8 +293,13 @@
     struct enumerator *ptr0, *ptr1;
 
     ptr0 = enumerator_ptr(orig);
-    ptr1 = enumerator_ptr(obj);
 
+    Data_Get_Struct(obj, struct enumerator, ptr1);
+
+    if (!ptr1) {
+	rb_raise(rb_eArgError, "unallocated enumerator");
+    }
+
     ptr1->obj  = ptr0->obj;
     ptr1->meth = ptr0->meth;
     ptr1->iter = ptr0->iter;

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

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