From e6c77e4c4cc56f98a1a19573693e7d30444f5da7 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 12 Dec 2002 07:29:14 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ marshal.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2f4e8e7e42..9f1b24f7bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Dec 12 16:26:31 2002 Nobuyoshi Nakada + + * marshal.c (r_object0): singleton class instance can't be loaded. + (ruby-bugs-ja:PR#366) + Wed Dec 11 23:35:43 2002 WATANABE Hirofumi * ext/extmk.rb (create_makefile): -no-undefined -> --no-undefined. diff --git a/marshal.c b/marshal.c index cc0ccbb35d..5d34b9e4c8 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: