summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-28 02:41:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-28 02:41:05 +0000
commit70dc199fdde6a70205410e0a8cfe4aff4c50344f (patch)
tree2c7df57d1caf8d36bb9c9374a8730108017ceaa2 /class.c
parent56201383cdf5ac4055d2eda136336624b4febde7 (diff)
* hash.c (rb_hash_become): Hash#become should check added
self-assignment. * class.c (rb_make_metaclass): metaclass of a superclass may be NULL at boot time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/class.c b/class.c
index d55c37e..316118b 100644
--- a/class.c
+++ b/class.c
@@ -152,7 +152,12 @@ rb_make_metaclass(obj, super)
RCLASS(klass)->super = RBASIC(rb_class_real(RCLASS(obj)->super))->klass;
}
else {
- RBASIC(klass)->klass = RBASIC(rb_class_real(super))->klass;
+ VALUE metasuper = RBASIC(rb_class_real(super))->klass;
+
+ /* metaclass of a superclass may be NULL at boot time */
+ if (metasuper) {
+ RBASIC(klass)->klass;
+ }
}
return klass;