Should not overwrite ci->target_class in mrb_exec_irep().

For example, the following code behaved wrong:

```ruby
Object.instance_exec(1,2,3){|*a|
  def foo
    42
  end
}
p foo()
```
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-12-20 19:59:15 +09:00
parent 7990bb7fa7
commit 7fbbd7ab9f
-1
View File
@@ -511,7 +511,6 @@ mrb_exec_irep(mrb_state *mrb, mrb_value self, struct RProc *p)
mrb->c->stack[0] = self;
ci->proc = p;
ci->target_class = MRB_PROC_TARGET_CLASS(p);
if (MRB_PROC_CFUNC_P(p)) {
return MRB_PROC_CFUNC(p)(mrb, self);
}