summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-08 01:22:58 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-08 01:22:58 +0000
commit64ec05158895f2c0a9f0aaf1249746d2e5566d00 (patch)
tree5c1e0b44c81bc3432b2ff61db3c359a5d542504a /struct.c
parentedaea1cd136ef1a8e5e405f9be841ba53fb6efd6 (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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/struct.c b/struct.c
index 88357dedc9..aaa2a4bce7 100644
--- a/struct.c
+++ b/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;
}