summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-18 08:40:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-18 08:40:33 +0000
commit74097260aeac51cb2839d90f5cf7eb4c84c9124f (patch)
tree4b2f781b6af183d2eb4bab2fce876d6addc021d3 /object.c
parentb49f3b26e5d96c22f3ccb578a5bef3dbff8f7dba (diff)
* eval.c (rb_thread_schedule): should not select a thread which is
not yet initialized. * variable.c (find_class_path): should initialize iv_tbl if it's NULL. * class.c (rb_define_class): should return the existing class if the class is already defined and its superclass is ideintical to the specified superclass. * class.c (rb_define_class_under): ditto. * class.c (rb_define_module): should return the existing module if the module is already defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/object.c b/object.c
index 3d5ea3af57..e95cbb7c0d 100644
--- a/object.c
+++ b/object.c
@@ -73,11 +73,12 @@ rb_obj_id(obj)
}
VALUE
-rb_obj_class(obj)
- VALUE obj;
+rb_class_real(cl)
+ VALUE cl;
{
- VALUE cl = CLASS_OF(obj);
-
+ if (TYPE(cl) == T_ICLASS) {
+ cl = RBASIC(cl)->klass;
+ }
while (FL_TEST(cl, FL_SINGLETON) || TYPE(cl) == T_ICLASS) {
cl = RCLASS(cl)->super;
}
@@ -85,6 +86,13 @@ rb_obj_class(obj)
}
VALUE
+rb_obj_class(obj)
+ VALUE obj;
+{
+ return rb_class_real(CLASS_OF(obj));
+}
+
+VALUE
rb_obj_clone(obj)
VALUE obj;
{