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

The tranpoline code in 6a0b68f8 was wrong; reverted.
parent ed0038fd
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment