summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-03 10:34:45 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-03 10:34:45 +0000
commit7e7cbad17eb6fc3b22f65ed98ea1c4d28afd2904 (patch)
treea39843774d43baaf5925b24e094c1bad5daaee67
parent552d3a5bcc9a78b460f75e190915331238fa1ef2 (diff)
* enumerator.c (enumerator_init_copy): Take care of
initialize_copy as well as initialize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--enumerator.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c535b529ca..427ee4b4e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jun 3 19:33:22 2008 Akinori MUSHA <knu@iDaemons.org>
+
+ * enumerator.c (enumerator_init_copy): Take care of
+ initialize_copy as well as initialize.
+
Tue Jun 3 16:06:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (file_expand_path): fix for non-existent files and SFN of
diff --git a/enumerator.c b/enumerator.c
index 0801517657..13c9bebeca 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -276,7 +276,12 @@ enumerator_init_copy(VALUE obj, VALUE orig)
/* 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;