vm.c (uvenv): move declaration to initialization

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-08-11 23:45:40 +09:00
parent 7ca60a0964
commit 22eb7e87af
+1 -2
View File
@@ -222,13 +222,12 @@ static inline struct REnv*
uvenv(mrb_state *mrb, mrb_int up)
{
const struct RProc *proc = mrb->c->ci->proc;
struct REnv *e;
while (up--) {
proc = proc->upper;
if (!proc) return NULL;
}
e = MRB_PROC_ENV(proc);
struct REnv *e = MRB_PROC_ENV(proc);
if (e) return e; /* proc has enclosed env */
return NULL;
}