diff --git a/ChangeLog b/ChangeLog index 87cae97a6b..32b421463f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Mar 20 22:54:50 2007 Yukihiro Matsumoto + + * marshal.c (w_extended): erroneous check condition when dump + method is defined. [ruby-core:10646] + Tue Mar 20 21:36:47 2007 Keiju Ishitsuka * lib/shell.rb, lib/shell: support for ruby 1.9(YARV) thread model. diff --git a/marshal.c b/marshal.c index 371886cf85..4cf4a9a049 100644 --- a/marshal.c +++ b/marshal.c @@ -343,8 +343,8 @@ w_extended(VALUE klass, struct dump_arg *arg, int 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"); } @@ -610,13 +610,13 @@ w_object(VALUE obj, struct dump_arg *arg, int 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; @@ -1198,7 +1198,7 @@ r_object0(struct load_arg *arg, int *ivp, VALUE extmod) VALUE data; v = rb_obj_alloc(klass); - if (! NIL_P(extmod)) { + if (!NIL_P(extmod)) { while (RARRAY_LEN(extmod) > 0) { VALUE m = rb_ary_pop(extmod); rb_extend_object(v, m);