Use mrb->object_class instead if MRB_PROC_TARGET_CLASS() is NULL

Fix #5725
This commit is contained in:
dearblue
2022-06-25 11:10:39 +09:00
parent ab3486d9ff
commit 1489338145
+1
View File
@@ -828,6 +828,7 @@ mrb_vm_const_get(mrb_state *mrb, mrb_sym sym)
proc = proc->upper;
while (proc) {
c2 = MRB_PROC_TARGET_CLASS(proc);
if (!c2) c2 = mrb->object_class;
if (c2 && iv_get(mrb, c2->iv, sym, &v)) {
return v;
}