Revert "class.c (include_module_at): narrow local variable scope"

C++ does not compile `goto` cross local variable declaration.
This reverts commit c618b44fee.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-03-10 19:33:49 +09:00
parent 1e36d7662c
commit 1e6442f54e
+2 -1
View File
@@ -1464,6 +1464,7 @@ include_class_new(mrb_state *mrb, struct RClass *m, struct RClass *super)
static int
include_module_at(mrb_state *mrb, struct RClass *c, struct RClass *ins_pos, struct RClass *m, int search_super)
{
struct RClass *ic;
void *klass_mt = find_origin(c)->mt;
while (m) {
@@ -1494,7 +1495,7 @@ include_module_at(mrb_state *mrb, struct RClass *c, struct RClass *ins_pos, stru
p = p->super;
}
struct RClass *ic = include_class_new(mrb, m, ins_pos->super);
ic = include_class_new(mrb, m, ins_pos->super);
m->flags |= MRB_FL_CLASS_IS_INHERITED;
ins_pos->super = ic;
mrb_field_write_barrier(mrb, (struct RBasic*)ins_pos, (struct RBasic*)ic);