summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-21 08:29:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-21 08:29:06 +0000
commit7c34e359a1d8e1affabeaa43377cf49f09933dfd (patch)
tree8a5568fbc4fe82c986a8c65f0cee8d5ae39c9817 /object.c
parent3e67076db01cbc53486e51f4b455220c9e4a3890 (diff)
* class.c (rb_check_inheritable): new function. [ruby-dev:22316]
* intern.h: add prototype. * eval.c (superclass): use rb_check_inheritable(). * object.c (rb_class_initialize): check argument validity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/object.c b/object.c
index 355d1e4..fda6410 100644
--- a/object.c
+++ b/object.c
@@ -776,6 +776,9 @@ rb_class_initialize(argc, argv, klass)
if (rb_scan_args(argc, argv, "01", &super) == 0) {
super = rb_cObject;
}
+ else {
+ rb_check_inheritable(super);
+ }
RCLASS(klass)->super = super;
rb_make_metaclass(klass, RBASIC(super)->klass);
rb_mod_initialize(klass);