summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-12 07:29:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-12 07:29:14 +0000
commite6c77e4c4cc56f98a1a19573693e7d30444f5da7 (patch)
treeddec13caafee0c74f16698dcd4d3942798038246 /marshal.c
parentd1f015f92ed06d93d9a5e0b90e4d35df3e6de1d3 (diff)
* marshal.c (r_object0): singleton class instance can't be loaded. (ruby-bugs-ja:PR#366)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/marshal.c b/marshal.c
index cc0ccbb..5d34b9e 100644
--- a/marshal.c
+++ b/marshal.c
@@ -902,6 +902,9 @@ r_object0(arg, proc)
{
VALUE c = path2class(r_unique(arg));
+ if (FL_TEST(c, FL_SINGLETON)) {
+ rb_raise(rb_eTypeError, "singleton can't be loaded");
+ }
v = r_object0(arg, 0);
if (rb_special_const_p(v) || TYPE(v) == T_OBJECT || TYPE(v) == T_CLASS) {
format_error: