summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-22 02:52:48 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-22 02:52:48 +0000
commitf9e621372df2551fa269f3c814246eca1e34e4fb (patch)
tree0a2df5670874674217d66c25d9f5dbaf3c757e6e /struct.c
parent570b766901c1a80f5a317012eb81ee9d1f301073 (diff)
* struct.c (make_struct): remove junk ID check to allow members who
have junk name like "foo\000". * test/ruby/test_struct.rb: Test for above. [Bug #7575] [ruby-dev:46750] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/struct.c b/struct.c
index 1de9bbed81..fc03130987 100644
--- a/struct.c
+++ b/struct.c
@@ -207,15 +207,13 @@ make_struct(VALUE name, VALUE members, VALUE klass)
len = RARRAY_LEN(members);
for (i=0; i< len; i++) {
ID id = SYM2ID(ptr_members[i]);
- if (rb_is_local_id(id) || rb_is_const_id(id)) {
- if (i < N_REF_FUNC) {
- rb_define_method_id(nstr, id, ref_func[i], 0);
- }
- else {
- rb_define_method_id(nstr, id, rb_struct_ref, 0);
- }
- rb_define_method_id(nstr, rb_id_attrset(id), rb_struct_set, 1);
+ if (i < N_REF_FUNC) {
+ rb_define_method_id(nstr, id, ref_func[i], 0);
+ }
+ else {
+ rb_define_method_id(nstr, id, rb_struct_ref, 0);
}
+ rb_define_method_id(nstr, rb_id_attrset(id), rb_struct_set, 1);
}
return nstr;