summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index 4b385dc117e..19a06a99f42 100644
--- a/marshal.c
+++ b/marshal.c
@@ -397,7 +397,9 @@ w_object(obj, arg, limit)
char *path;
if (FL_TEST(klass, FL_SINGLETON)) {
- rb_raise(rb_eTypeError, "singleton can't be dumped");
+ if (RCLASS(klass)->m_tbl->num_entries > 0) {
+ rb_raise(rb_eTypeError, "singleton can't be dumped");
+ }
}
path = rb_class2name(klass);
w_unique(path, arg);