summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-16 14:25:19 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-16 14:25:19 (GMT)
commit53e4fb8c8027bd28f4aa8cda605b403b1a8a9aa4 (patch)
tree9a0b18490c47eeb1872eef9e4cf6236ee1a0d17c /marshal.c
parentbdf16df33ae3eb9e6c513c29bcbb250dc8c9542b (diff)
marshal.c: class name encoding
* marshal.c (r_object0): preserve the encoding of the class name in an error message, in the case of no _load_data method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/marshal.c b/marshal.c
index 9587783..ba5e75c 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1878,7 +1878,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
case TYPE_DATA:
{
- VALUE klass = path2class(r_unique(arg));
+ VALUE name = r_unique(arg);
+ VALUE klass = path2class(name);
VALUE oldclass = 0;
VALUE r;
@@ -1889,8 +1890,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
v = r_entry(v, arg);
if (!rb_obj_respond_to(v, s_load_data, TRUE)) {
rb_raise(rb_eTypeError,
- "class %s needs to have instance method `_load_data'",
- rb_class2name(klass));
+ "class %"PRIsVALUE" needs to have instance method `_load_data'",
+ name);
}
r = r_object0(arg, 0, extmod);
rb_funcall2(v, s_load_data, 1, &r);