* struct.c (rb_struct_s_members): should raise TypeError instead

of call rb_bug().  [ruby-dev:31709]

* marshal.c (r_object0): no nil check require any more.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-09-08 01:22:58 +00:00
parent edaea1cd13
commit 64ec051588
4 changed files with 14 additions and 7 deletions

View file

@ -41,7 +41,10 @@ rb_struct_s_members(klass)
VALUE members = rb_struct_iv_get(klass, "__members__");
if (NIL_P(members)) {
rb_bug("non-initialized struct");
rb_raise(rb_eTypeError, "uninitialized struct");
}
if (TYPE(members) != T_ARRAY) {
rb_raise(rb_eTypeError, "corrupted struct");
}
return members;
}