From faa4eaf6803bd11669bc324b4c34e7162286bfa3 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 8 Jun 2018 14:13:06 +0900 Subject: `mrb_class_real()` did not work for `BasicObject`; fix #4037 --- src/class.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/class.c b/src/class.c index c761f46af..a9439d7d7 100644 --- a/src/class.c +++ b/src/class.c @@ -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; } -- cgit v1.2.3