diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-07-05 10:01:06 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2019-08-29 08:17:43 -0700 |
commit | e51dca2596db9567bd4d698b18b4d300575d3881 (patch) | |
tree | f04771880ddb471d34ed063d90fa04619f945571 /struct.c | |
parent | 01b723ba6dd48a0954765e43cff6bd9212afe259 (diff) |
Disallow use of attrset symbols as Struct members
Fixes [Bug #11326]
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -551,6 +551,9 @@ rb_struct_s_def(int argc, VALUE *argv, VALUE klass) tbl = RHASH_TBL(rest); for (i=0; i<argc; i++) { VALUE mem = rb_to_symbol(argv[i]); + if (rb_is_attrset_sym(mem)) { + rb_raise(rb_eArgError, "invalid struct member: %"PRIsVALUE, mem); + } if (st_insert(tbl, mem, Qtrue)) { rb_raise(rb_eArgError, "duplicate member: %"PRIsVALUE, mem); } |