summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-16 14:25:33 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-16 14:25:33 (GMT)
commit0ea135d177cfda4ea565d8f3934379ccf405826d (patch)
treee78a8a5a5ec48d70f64f1b7d38b791262c7ed88e /marshal.c
parent53e4fb8c8027bd28f4aa8cda605b403b1a8a9aa4 (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 USERDEF without _load singleton method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50332 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 ba5e75c..3d42c7b 100644
--- a/marshal.c
+++ b/marshal.c
@@ -1815,12 +1815,13 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod)
case TYPE_USERDEF:
{
- VALUE klass = path2class(r_unique(arg));
+ VALUE name = r_unique(arg);
+ VALUE klass = path2class(name);
VALUE data;
if (!rb_obj_respond_to(klass, s_load, TRUE)) {
- rb_raise(rb_eTypeError, "class %s needs to have method `_load'",
- rb_class2name(klass));
+ rb_raise(rb_eTypeError, "class %"PRIsVALUE" needs to have method `_load'",
+ name);
}
data = r_string(arg);
if (ivp) {