1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* marshal.c (r_object): yield loaded objects, not intermediates.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2002-08-28 15:58:35 +00:00
parent 5c70716bdc
commit 9208c74718
2 changed files with 20 additions and 8 deletions

View file

@ -1,3 +1,7 @@
Thu Aug 29 00:55:55 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* marshal.c (r_object): yield loaded objects, not intermediates.
Wed Aug 28 23:59:15 2002 Michal Rokos <michal@ruby-lang.org>
* signal.c: remove #ifdef SIGINT for struct signals.

View file

@ -814,8 +814,9 @@ r_ivar(obj, arg)
}
static VALUE
r_object(arg)
r_object0(arg, proc)
struct load_arg *arg;
VALUE proc;
{
VALUE v = Qnil;
int type = r_byte(arg);
@ -831,15 +832,15 @@ r_object(arg)
return v;
case TYPE_IVAR:
v = r_object(arg);
v = r_object0(arg, 0);
r_ivar(v, arg);
return v;
break;
case TYPE_UCLASS:
{
VALUE c = rb_path2class(r_unique(arg));
v = r_object(arg);
v = r_object0(arg, 0);
if (rb_special_const_p(v) || TYPE(v) == T_OBJECT || TYPE(v) == T_CLASS) {
format_error:
rb_raise(rb_eArgError, "dump format error (user class)");
@ -850,8 +851,8 @@ r_object(arg)
if (TYPE(v) != TYPE(tmp)) goto format_error;
}
RBASIC(v)->klass = c;
return v;
}
break;
case TYPE_NIL:
v = Qnil;
@ -1061,7 +1062,7 @@ r_object(arg)
"class %s needs to have instance method `_load_data'",
rb_class2name(klass));
}
rb_funcall(v, s_load_data, 1, r_object(arg));
rb_funcall(v, s_load_data, 1, r_object0(arg, 0));
}
break;
@ -1108,12 +1109,19 @@ r_object(arg)
rb_raise(rb_eArgError, "dump format error(0x%x)", type);
break;
}
if (arg->proc) {
rb_funcall(arg->proc, rb_intern("yield"), 1, v);
if (proc) {
rb_funcall(proc, rb_intern("yield"), 1, v);
}
return v;
}
static VALUE
r_object(arg)
struct load_arg *arg;
{
return r_object0(arg, arg->proc);
}
static VALUE
load(arg)
struct load_arg *arg;