summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/struct.c b/struct.c
index f87b33b050..671788fc10 100644
--- a/struct.c
+++ b/struct.c
@@ -39,6 +39,9 @@ rb_struct_s_members(VALUE klass)
if (NIL_P(members)) {
rb_raise(rb_eTypeError, "uninitialized struct");
}
+ if (TYPE(members) != T_ARRAY) {
+ rb_raise(rb_eTypeError, "corrupted struct");
+ }
return members;
}