variable.c (mrb_const_get): adjust local variable scope

This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-04-09 22:29:17 +09:00
parent 52de3b7e10
commit 0d5fecf833
+3 -5
View File
@@ -825,17 +825,15 @@ mrb_const_get(mrb_state *mrb, mrb_value mod, mrb_sym sym)
mrb_value
mrb_vm_const_get(mrb_state *mrb, mrb_sym sym)
{
struct RClass *c;
struct RClass *c2;
mrb_value v;
const struct RProc *proc = mrb->c->ci->proc;
struct RClass *c = MRB_PROC_TARGET_CLASS(proc);
mrb_value v;
c = MRB_PROC_TARGET_CLASS(proc);
if (!c) c = mrb->object_class;
if (iv_get(mrb, class_iv_ptr(c), sym, &v)) {
return v;
}
c2 = c;
struct RClass *c2 = c;
while (c2 && c2->tt == MRB_TT_SCLASS) {
mrb_value klass;