From 61c6832b486ec4fc01353109c8c4085c88fa8f76 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 21 Apr 2020 15:44:21 +0900 Subject: Fix the bug by `#instance_eval` called via a method object; fix #4973 The tranpoline code in 6a0b68f8b was wrong; reverted. --- src/vm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/vm.c b/src/vm.c index bcd846025..f8f4609bf 100644 --- a/src/vm.c +++ b/src/vm.c @@ -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); -- cgit v1.2.3