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

ruby-changes:5291

From: knu <ko1@a...>
Date: Tue, 3 Jun 2008 19:37:29 +0900 (JST)
Subject: [ruby-changes:5291] Ruby:r16790 (trunk): * enumerator.c (enumerator_init_copy): Take care of

knu	2008-06-03 19:34:45 +0900 (Tue, 03 Jun 2008)

  New Revision: 16790

  Modified files:
    trunk/ChangeLog
    trunk/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/trunk/ChangeLog?r1=16790&r2=16789&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enumerator.c?r1=16790&r2=16789&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 16789)
+++ ChangeLog	(revision 16790)
@@ -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: enumerator.c
===================================================================
--- enumerator.c	(revision 16789)
+++ enumerator.c	(revision 16790)
@@ -276,8 +276,13 @@
 	/* Fibers cannot be copied */
 	rb_raise(rb_eTypeError, "can't copy execution context");
     }
-    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->args = ptr0->args;

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

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