mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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/trunk@12111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
42a81120e5
commit
ed224698b5
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Mar 20 22:54:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* marshal.c (w_extended): erroneous check condition when dump
|
||||
method is defined. [ruby-core:10646]
|
||||
|
||||
Tue Mar 20 21:36:47 2007 Keiju Ishitsuka <keiju@ruby-lang.org>
|
||||
|
||||
* lib/shell.rb, lib/shell: support for ruby 1.9(YARV) thread model.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue