vm.c (check_target_class): return Object class if target is NULL.
Since target_class kept in a Proc may be NULL. It crashes
`iij/mruby-require` gem for example; close
@@ -1153,8 +1153,7 @@ check_target_class(mrb_state *mrb)
{
struct RClass *target = mrb_vm_ci_target_class(mrb->c->ci);
if (!target) {
- mrb_value exc = mrb_exc_new_lit(mrb, E_TYPE_ERROR, "no target class or module");
- mrb_exc_set(mrb, exc);
+ return mrb->object_class;
}
return target;
}
