diff --git a/src/vm.c b/src/vm.c index 20d9b4f85..09ae7c651 100644 --- a/src/vm.c +++ b/src/vm.c @@ -1011,6 +1011,7 @@ mrb_mod_module_eval(mrb_state *mrb, mrb_value mod) if (mrb_get_args(mrb, "|S&", &a, &b) == 1) { mrb_raise(mrb, E_NOTIMP_ERROR, "module_eval/class_eval with string not implemented"); } + MRB_SET_VISIBILITY(mrb_class_ptr(mod), MRB_METHOD_PUBLIC_FL); return eval_under(mrb, mod, b, mrb_class_ptr(mod)); } @@ -2940,6 +2941,9 @@ RETRY_TRY_BLOCK: struct RClass *c = mrb_class_ptr(recv); const mrb_irep *nirep = irep->reps[b]; + /* restore visibility */ + MRB_SET_VISIBILITY(c, MRB_METHOD_PUBLIC_FL); + /* prepare closure */ struct RProc *p = mrb_proc_new(mrb, nirep); p->c = NULL;