ci->target_class should be updated as well; #1418

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-08-01 11:56:20 +09:00
parent c550a0f834
commit 7f282429b0
+6 -1
View File
@@ -5245,10 +5245,15 @@ load_exec(mrb_state *mrb, parser_state *p, mrbc_context *c)
if (c) {
if (c->dump_result) codedump_all(mrb, n);
if (c->no_exec) return mrb_fixnum_value(n);
if (c->target_class) target = c->target_class;
if (c->target_class) {
target = c->target_class;
}
}
proc = mrb_proc_new(mrb, mrb->irep[n]);
proc->target_class = target;
if (mrb->c->ci) {
mrb->c->ci->target_class = target;
}
v = mrb_run(mrb, proc, mrb_top_self(mrb));
if (mrb->exc) return mrb_nil_value();
return v;