summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-20 08:40:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-20 08:40:50 +0000
commit56a4cc27edbe89dc65147a6a5f667cb838cfabc3 (patch)
treeb8479a41c7a1d8f8dda91c4e80786192624f46dd
parentfdc0d3306c856a604e5add86696173f21d8bb9c6 (diff)
* object.c (init_copy): call initialize_copy at the end of copy
process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--object.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4f8e91f6732..24867d32779 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 20 17:39:15 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * object.c (init_copy): call initialize_copy at the end of copy
+ process.
+
Tue May 20 17:15:55 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* error.c (syserr_initialize): use Errno constants as default
diff --git a/object.c b/object.c
index cfd9ce9a0e5..c79b1277463 100644
--- a/object.c
+++ b/object.c
@@ -112,7 +112,6 @@ init_copy(dest, obj)
}
RBASIC(dest)->flags &= ~(T_MASK|FL_EXIVAR);
RBASIC(dest)->flags |= RBASIC(obj)->flags & (T_MASK|FL_EXIVAR|FL_TAINT);
- rb_funcall(dest, id_init_copy, 1, obj);
if (FL_TEST(obj, FL_EXIVAR)) {
rb_copy_generic_ivar(dest, obj);
}
@@ -129,6 +128,7 @@ init_copy(dest, obj)
ROBJECT(dest)->iv_tbl = st_copy(ROBJECT(obj)->iv_tbl);
}
}
+ rb_funcall(dest, id_init_copy, 1, obj);
}
VALUE
@@ -141,9 +141,9 @@ rb_obj_clone(obj)
rb_raise(rb_eTypeError, "can't clone %s", rb_obj_classname(obj));
}
clone = rb_obj_alloc(rb_obj_class(obj));
- init_copy(clone, obj);
RBASIC(clone)->klass = rb_singleton_class_clone(obj);
RBASIC(clone)->flags = RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT);
+ init_copy(clone, obj);
return clone;
}