Merge pull request #6175 from dearblue/mrb_vm_run-cond

Corrected strange conditional in `mrb_vm_run()`
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-02-18 22:11:45 +09:00
committed by GitHub
+1 -1
View File
@@ -1320,7 +1320,7 @@ mrb_vm_run(mrb_state *mrb, const struct RProc *proc, mrb_value self, mrb_int sta
nregs = stack_keep;
else {
struct REnv *e = CI_ENV(mrb->c->ci);
if (stack_keep == 0 || (e && irep->nlocals < MRB_ENV_LEN(e))) {
if (e && (stack_keep == 0 || irep->nlocals < MRB_ENV_LEN(e))) {
ci_env_set(mrb->c->ci, NULL);
mrb_env_unshare(mrb, e, FALSE);
}