mrb_class_real() did not work for BasicObject; fix #4037

This commit is contained in:
Yukihiro "Matz" Matsumoto
2018-06-08 14:13:06 +09:00
parent 55edae0226
commit faa4eaf680
+2 -2
View File
@@ -1763,10 +1763,10 @@ mrb_class_path(mrb_state *mrb, struct RClass *c)
MRB_API struct RClass*
mrb_class_real(struct RClass* cl)
{
if (cl == 0)
return NULL;
if (cl == 0) return NULL;
while ((cl->tt == MRB_TT_SCLASS) || (cl->tt == MRB_TT_ICLASS)) {
cl = cl->super;
if (cl == 0) return NULL;
}
return cl;
}