vm.c (mrb_object_exec): update ci's target class by update function

To avoid breaking a Proc with env set.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-03-06 23:12:00 +09:00
parent fb56fecf51
commit 67e85ed296
+1 -1
View File
@@ -854,7 +854,7 @@ mrb_object_exec(mrb_state *mrb, mrb_value self, struct RClass *target_class)
mrb_assert(mrb_proc_p(blk));
mrb_gc_protect(mrb, blk);
ci->stack[bidx] = mrb_nil_value();
ci->u.target_class = target_class;
mrb_vm_ci_target_class_set(ci, target_class);
return mrb_exec_irep(mrb, self, mrb_proc_ptr(blk));
}