should not try to set classpath for frozen classes; ref #3340

parent 6ac54734
...@@ -1589,8 +1589,10 @@ mrb_class_path(mrb_state *mrb, struct RClass *c) ...@@ -1589,8 +1589,10 @@ mrb_class_path(mrb_state *mrb, struct RClass *c)
name = mrb_sym2name_len(mrb, sym, &len); name = mrb_sym2name_len(mrb, sym, &len);
path = mrb_str_new(mrb, name, len); path = mrb_str_new(mrb, name, len);
} }
if (!MRB_FROZEN_P(c)) {
mrb_obj_iv_set(mrb, (struct RObject*)c, classpath, path); mrb_obj_iv_set(mrb, (struct RObject*)c, classpath, path);
} }
}
return mrb_str_dup(mrb, path); return mrb_str_dup(mrb, path);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment