mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* 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:
parent
edaea1cd13
commit
64ec051588
4 changed files with 14 additions and 7 deletions
5
struct.c
5
struct.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue