summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-07 00:20:49 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-07 00:20:49 +0000
commit8d1476705ca1dd73ff19e1cc0e516e61f4bf94df (patch)
treeb8f1d71bf7fecff539c5942016ea252aa4a9357d
parentf404fa90ff2ff833feb60dc73d87c673077a3d99 (diff)
downloadruby-8d1476705ca1dd73ff19e1cc0e516e61f4bf94df.tar.gz
ruby-8d1476705ca1dd73ff19e1cc0e516e61f4bf94df.tar.xz
ruby-8d1476705ca1dd73ff19e1cc0e516e61f4bf94df.zip
* eval.c (superclass): undesirable "unexpected return" when the superclass is not a Class.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--eval.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fa2ff7c4d..77f560e98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 7 09:17:51 2002 Minero Aoki <aamine@loveruby.net>
+
+ * eval.c (superclass): undesirable "unexpected return" when the
+ superclass is not a Class.
+
Sun May 5 06:53:45 2002 Akinori MUSHA <knu@iDaemons.org>
* lib/mkmf.rb: exclude topdir from the system configuration
diff --git a/eval.c b/eval.c
index 4cbdc79c0..77d2f571d 100644
--- a/eval.c
+++ b/eval.c
@@ -1445,7 +1445,6 @@ superclass(self, node)
}
POP_TAG();
if (state) {
- superclass_error:
switch (nd_type(node)) {
case NODE_COLON2:
rb_raise(rb_eTypeError, "undefined superclass `%s'",
@@ -1458,7 +1457,10 @@ superclass(self, node)
}
JUMP_TAG(state);
}
- if (TYPE(val) != T_CLASS) goto superclass_error;
+ if (TYPE(val) != T_CLASS) {
+ rb_raise(rb_eTypeError, "superclass must be a Class (%s given)",
+ rb_class2name(CLASS_OF(val)));
+ }
if (FL_TEST(val, FL_SINGLETON)) {
rb_raise(rb_eTypeError, "can't make subclass of virtual class");
}