mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
supeclass type check prohibits class definition without superclass specified
This commit is contained in:
+4
-2
@@ -213,8 +213,10 @@ mrb_vm_define_class(mrb_state *mrb, mrb_value outer, mrb_value super, mrb_sym id
|
||||
if (!c) {
|
||||
struct RClass *s = 0;
|
||||
|
||||
mrb_check_type(mrb, super, MRB_TT_CLASS);
|
||||
if (!mrb_nil_p(super)) s = mrb_class_ptr(super);
|
||||
if (!mrb_nil_p(super)) {
|
||||
mrb_check_type(mrb, super, MRB_TT_CLASS);
|
||||
s = mrb_class_ptr(super);
|
||||
}
|
||||
c = mrb_class_new(mrb, s);
|
||||
setup_class(mrb, outer, c, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user