* struct.c (rb_struct_s_members): wrong call of struct_members.

[ruby-dev:24333]

* eval.c (proc_invoke): propagate DVAR_DONT_RECYCLE on termination
  to avoid double call to rb_gc_force_recycle(). [ruby-dev:24311]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-09-24 16:58:51 +00:00
parent 7c29bcfb03
commit 08f84dcf44
3 changed files with 36 additions and 6 deletions

View file

@ -33,11 +33,23 @@ rb_struct_iv_get(c, name)
}
}
static VALUE
struct_s_members(klass)
VALUE klass;
{
VALUE members = rb_struct_iv_get(klass, "__members__");
if (NIL_P(members)) {
rb_bug("non-initialized struct");
}
return members;
}
static VALUE
struct_members(s)
VALUE s;
{
VALUE members = rb_struct_iv_get(rb_obj_class(s), "__members__");
VALUE members = struct_s_members(rb_obj_class(s));
if (NIL_P(members)) {
rb_bug("non-initialized struct");
@ -50,13 +62,13 @@ struct_members(s)
}
static VALUE
rb_struct_s_members(obj)
VALUE obj;
rb_struct_s_members(klass)
VALUE klass;
{
VALUE members, ary;
VALUE *p, *pend;
members = struct_members(obj);
members = struct_s_members(klass);
ary = rb_ary_new2(RARRAY(members)->len);
p = RARRAY(members)->ptr; pend = p + RARRAY(members)->len;
while (p < pend) {