Skip to content

Commit 1e6442f

Browse files
committed
Revert "class.c (include_module_at): narrow local variable scope"
C++ does not compile `goto` cross local variable declaration. This reverts commit c618b44.
1 parent 1e36d76 commit 1e6442f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/class.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,7 @@ include_class_new(mrb_state *mrb, struct RClass *m, struct RClass *super)
14641464
static int
14651465
include_module_at(mrb_state *mrb, struct RClass *c, struct RClass *ins_pos, struct RClass *m, int search_super)
14661466
{
1467+
struct RClass *ic;
14671468
void *klass_mt = find_origin(c)->mt;
14681469

14691470
while (m) {
@@ -1494,7 +1495,7 @@ include_module_at(mrb_state *mrb, struct RClass *c, struct RClass *ins_pos, stru
14941495
p = p->super;
14951496
}
14961497

1497-
struct RClass *ic = include_class_new(mrb, m, ins_pos->super);
1498+
ic = include_class_new(mrb, m, ins_pos->super);
14981499
m->flags |= MRB_FL_CLASS_IS_INHERITED;
14991500
ins_pos->super = ic;
15001501
mrb_field_write_barrier(mrb, (struct RBasic*)ins_pos, (struct RBasic*)ic);

0 commit comments

Comments
 (0)