diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-06-08 14:13:06 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-06-08 14:13:06 +0900 |
| commit | faa4eaf6803bd11669bc324b4c34e7162286bfa3 (patch) | |
| tree | e5275d2a4552c461aca6583266ce3b612be62c38 /src | |
| parent | 55edae0226409de25e59922807cb09acb45731a2 (diff) | |
| download | mruby-faa4eaf6803bd11669bc324b4c34e7162286bfa3.tar.gz mruby-faa4eaf6803bd11669bc324b4c34e7162286bfa3.zip | |
`mrb_class_real()` did not work for `BasicObject`; fix #4037
Diffstat (limited to 'src')
| -rw-r--r-- | src/class.c | 4 |
1 files 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; } |
