move mrb_str_dup() to mrb_class_path; ref #2470

Class#to_s used to return same string repeatedly,
that mean you can modify "class name" by modifying
the return value from Class#to_s.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-11-13 16:12:13 +09:00
parent 01dddaf385
commit 1422e57630
+1 -1
View File
@@ -1539,7 +1539,7 @@ mrb_class_path(mrb_state *mrb, struct RClass *c)
}
mrb_obj_iv_set(mrb, (struct RObject*)c, classpath, path);
}
return path;
return mrb_str_dup(mrb, path);
}
MRB_API struct RClass *