aboutsummaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-28 06:02:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-28 06:02:06 +0000
commit1ef1a0c6024daee5278885cd75dbe445299ebd7c (patch)
tree955082fed7290f8c23cf1d5ff823d4d47774d850 /variable.c
parent0066608c1317c95f0faf181edc28c158ed050f6a (diff)
downloadruby-1ef1a0c6024daee5278885cd75dbe445299ebd7c.tar.gz
variable.c: preserve name encoding of subclass
* variable.c (rb_tmp_class_path): preserve name encoding of an anonymous instance of module/class subclass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/variable.c b/variable.c
index 9d5ab9f422..f2c574982e 100644
--- a/variable.c
+++ b/variable.c
@@ -228,21 +228,19 @@ rb_tmp_class_path(VALUE klass, int *permanent, path_cache_func cache_path)
return (VALUE)n;
}
else {
- const char *s = "Class";
-
if (RB_TYPE_P(klass, T_MODULE)) {
if (rb_obj_class(klass) == rb_cModule) {
- s = "Module";
+ path = rb_sprintf("#<Module:%p>", (void*)klass);
}
else {
int perm;
- VALUE path;
-
path = rb_tmp_class_path(RBASIC(klass)->klass, &perm, cache_path);
- s = RSTRING_PTR(path);
+ path = rb_sprintf("#<%"PRIsVALUE":%p>", path, (void*)klass);
}
}
- path = rb_sprintf("#<%s:%p>", s, (void*)klass);
+ else {
+ path = rb_sprintf("#<Class:%p>", (void*)klass);
+ }
OBJ_FREEZE(path);
cache_path(klass, tmp_classpath, path);