summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-11 05:24:59 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-05-11 05:24:59 +0000
commitcc043890f8cb7c0c057fb076b30765973716c470 (patch)
tree7e7a184bde865a5d67350923fbee84a5ea115f1e /marshal.c
parent076ef717ac48d8093252ed47f9b0591416f339a4 (diff)
* bignum.c (bigdivrem): access boundary bug.
* marshal.c (w_object): prohibit dumping out singleton classes. * object.c (rb_mod_to_s): distinguish singleton classes. * variable.c (rb_class2name): it's ok to reveal NilClass, TrueClass, FalseClass. * eval.c (rb_yield_0): preserve and restore ruby_cref as well. * eval.c (is_defined): core dumped during instance_eval for special constants. * eval.c (rb_eval): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index 108379d..a0dfb68 100644
--- a/marshal.c
+++ b/marshal.c
@@ -342,6 +342,9 @@ w_object(obj, arg, limit)
switch (BUILTIN_TYPE(obj)) {
case T_CLASS:
+ if (FL_TEST(obj, FL_SINGLETON)) {
+ rb_raise(rb_eTypeError, "singleton class can't be dumped");
+ }
w_byte(TYPE_CLASS, arg);
{
VALUE path = rb_class_path(obj);
@@ -460,7 +463,8 @@ w_object(obj, arg, limit)
char *path;
if (FL_TEST(klass, FL_SINGLETON)) {
- if (RCLASS(klass)->m_tbl->num_entries > 0) {
+ if (RCLASS(klass)->m_tbl->num_entries > 0 ||
+ RCLASS(klass)->iv_tbl->num_entries > 1) {
rb_raise(rb_eTypeError, "singleton can't be dumped");
}
}