summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
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 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: