summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-11 18:03:43 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-11 18:03:43 +0000
commit9d70a17541782493c7cf5d0dceafadccc2424bd8 (patch)
tree746711090e8743e238e636cec88eab54064091cd /class.c
parent3b0abede8ef1a89c4798be11c46922924e21484e (diff)
revert r43259 because it is possible to mark miss classes defined in C-exts. Thanks charliesome.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/class.c b/class.c
index a50c94c..2573bd9 100644
--- a/class.c
+++ b/class.c
@@ -31,6 +31,7 @@
#include "internal.h"
#include <ctype.h>
+extern st_table *rb_class_tbl;
#define id_attached id__attached__
void
@@ -516,10 +517,12 @@ make_singleton_class(VALUE obj)
static VALUE
boot_defclass(const char *name, VALUE super)
{
+ extern st_table *rb_class_tbl;
VALUE obj = rb_class_boot(super);
ID id = rb_intern(name);
rb_name_class(obj, id);
+ st_add_direct(rb_class_tbl, id, obj);
rb_const_set((rb_cObject ? rb_cObject : obj), id, obj);
return obj;
}
@@ -640,6 +643,7 @@ rb_define_class(const char *name, VALUE super)
rb_warn("no super class for `%s', Object assumed", name);
}
klass = rb_define_class_id(id, super);
+ st_add_direct(rb_class_tbl, id, klass);
rb_name_class(klass, id);
rb_const_set(rb_cObject, id, klass);
rb_class_inherited(super, klass);
@@ -750,6 +754,7 @@ rb_define_module(const char *name)
rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module));
}
module = rb_define_module_id(id);
+ st_add_direct(rb_class_tbl, id, module);
rb_const_set(rb_cObject, id, module);
return module;