Make mrb_obj_instance_eval to use mrb_singleton_class_ptr; #4973

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-04-22 16:47:26 +09:00
parent 87d1bbe947
commit ab508e1e7f
+1 -5
View File
@@ -723,15 +723,11 @@ mrb_value
mrb_obj_instance_eval(mrb_state *mrb, mrb_value self)
{
mrb_value a, b;
mrb_value cv;
struct RClass *c;
if (mrb_get_args(mrb, "|S&", &a, &b) == 1) {
mrb_raise(mrb, E_NOTIMP_ERROR, "instance_eval with string not implemented");
}
cv = mrb_singleton_class(mrb, self);
c = mrb_class_ptr(cv);
return eval_under(mrb, self, b, c);
return eval_under(mrb, self, b, mrb_singleton_class_ptr(mrb, self));
}
MRB_API mrb_value