diff options
| author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-03 10:55:17 +0000 |
|---|---|---|
| committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-03 10:55:17 +0000 |
| commit | 2bc5bfdc67f5ed31d471dc37c02da45ffb44d680 (patch) | |
| tree | 0edd7374000c7c007e2f2129061e2e35189ea899 | |
| parent | cfe0f3e6ace78e9fb5e82c37a775935b4248932c (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/branches/ruby_1_8@16791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | enumerator.c | 7 |
2 files changed, 11 insertions, 1 deletions
@@ -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 8d5061d308..f95d931b62 100644 --- a/enumerator.c +++ b/enumerator.c @@ -293,7 +293,12 @@ enumerator_init_copy(obj, orig) 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; |
