summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-16 14:28:29 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-16 14:28:29 (GMT)
commit982a9d8e91a0de6abd2af3d888aba1aa2880103c (patch)
treecd08c6f45606c10a1f16ee081ffd030fa164cb30 /marshal.c
parent0ea135d177cfda4ea565d8f3934379ccf405826d (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 USRMARSHAL without marshal_load method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50333 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 3d42c7b..8eb7b07 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1837,7 +1837,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
case TYPE_USRMARSHAL:
{
- VALUE klass = path2class(r_unique(arg));
+ VALUE name = r_unique(arg);
+ VALUE klass = path2class(name);
VALUE oldclass = 0;
VALUE data;
@@ -1847,8 +1848,8 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
append_extmod(v, extmod);
}
if (!rb_obj_respond_to(v, s_mload, TRUE)) {
- rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'",
- rb_class2name(klass));
+ rb_raise(rb_eTypeError, "instance of %"PRIsVALUE" needs to have method `marshal_load'",
+ name);
}
v = r_entry(v, arg);
data = r_object(arg);