Fix the bug by #instance_eval called via a method object; fix #4973

The tranpoline code in 6a0b68f8b was wrong; reverted.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-04-21 15:44:21 +09:00
parent ed0038fdf2
commit 61c6832b48
+1 -2
View File
@@ -648,8 +648,7 @@ eval_under(mrb_state *mrb, mrb_value self, mrb_value blk, struct RClass *c)
}
ci = mrb->c->ci;
if (ci->acc == CI_ACC_DIRECT) {
ci->target_class = c;
return mrb_yield_cont(mrb, blk, self, 1, &self);
return mrb_yield_with_class(mrb, blk, 1, &self, self, c);
}
ci->target_class = c;
p = mrb_proc_ptr(blk);