diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-08 01:22:58 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-08 01:22:58 +0000 |
commit | 64ec05158895f2c0a9f0aaf1249746d2e5566d00 (patch) | |
tree | 5c1e0b44c81bc3432b2ff61db3c359a5d542504a /struct.c | |
parent | edaea1cd136ef1a8e5e405f9be841ba53fb6efd6 (diff) |
* 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
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |