summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-21 23:27:29 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-21 23:27:29 +0000
commitf281362a1ab12a08fb7c145d8a8a3902e108bede (patch)
treec3743188a6a880dc769f6b4a28e4b0616d44b809 /marshal.c
parent4da4302e056072975dd010ba2f3789ecbfb3db16 (diff)
* marshal.c (w_extended): erroneous check condition when dump
method is defined. [ruby-core:10646] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/marshal.c b/marshal.c
index 51771fd..185ace6 100644
--- a/marshal.c
+++ b/marshal.c
@@ -373,8 +373,8 @@ w_extended(klass, arg, check)
{
char *path;
- if (FL_TEST(klass, FL_SINGLETON)) {
- if (check && RCLASS(klass)->m_tbl->num_entries ||
+ if (check && FL_TEST(klass, FL_SINGLETON)) {
+ if (RCLASS(klass)->m_tbl->num_entries ||
(RCLASS(klass)->iv_tbl && RCLASS(klass)->iv_tbl->num_entries > 1)) {
rb_raise(rb_eTypeError, "singleton can't be dumped");
}
@@ -652,13 +652,13 @@ w_object(obj, arg, limit)
{
VALUE v;
- w_class(TYPE_DATA, obj, arg, Qtrue);
if (!rb_respond_to(obj, s_dump_data)) {
rb_raise(rb_eTypeError,
"no marshal_dump is defined for class %s",
rb_obj_classname(obj));
}
v = rb_funcall(obj, s_dump_data, 0);
+ w_class(TYPE_DATA, obj, arg, Qtrue);
w_object(v, arg, limit);
}
break;