Commit 55cb6258 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Fix modifiable class name

Fix the following example:

    Object.const_set :A, Module.new{const_set :B, Class.new}
    ab = A::B.to_s
    p ab         #=> "A::B" # Good
    ab[0] = "x"
    p A::B.to_s  #=> "x::B" # Bad
parent 6ec855a3
......@@ -1106,6 +1106,7 @@ mrb_class_find_path(mrb_state *mrb, struct RClass *c)
iv_del(mrb, c->iv, mrb_intern_lit(mrb, "__outer__"), NULL);
iv_put(mrb, c->iv, mrb_intern_lit(mrb, "__classname__"), path);
mrb_field_write_barrier_value(mrb, (struct RBasic*)c, path);
path = mrb_str_dup(mrb, path);
}
return 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