Skip to content

Commit 9cef265

Browse files
committed
should not try to set classpath for frozen classes; ref #3340
1 parent 6ac5473 commit 9cef265

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/class.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,9 @@ mrb_class_path(mrb_state *mrb, struct RClass *c)
15891589
name = mrb_sym2name_len(mrb, sym, &len);
15901590
path = mrb_str_new(mrb, name, len);
15911591
}
1592-
mrb_obj_iv_set(mrb, (struct RObject*)c, classpath, path);
1592+
if (!MRB_FROZEN_P(c)) {
1593+
mrb_obj_iv_set(mrb, (struct RObject*)c, classpath, path);
1594+
}
15931595
}
15941596
return mrb_str_dup(mrb, path);
15951597
}

0 commit comments

Comments
 (0)