diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-29 14:45:46 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-29 14:45:46 +0000 |
commit | 6496dc892dac58dc3267872c7a1f04bb7843dce3 (patch) | |
tree | f8bd0c642e26a4ee994c8d72a94bd8cb18aeeafc /parse.y | |
parent | 5a48805be81895a9137873a71110ea079ae3a875 (diff) | |
download | ruby-6496dc892dac58dc3267872c7a1f04bb7843dce3.tar.gz |
parse.y: allow junk attrset
* parse.y (rb_id_attrset, intern_str): allow junk attrset ID for
Struct.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -8895,7 +8895,7 @@ rb_id_attrset(ID id) int scope = (int)(id & ID_SCOPE_MASK); switch (scope) { case ID_LOCAL: case ID_INSTANCE: case ID_GLOBAL: - case ID_CONST: case ID_CLASS: + case ID_CONST: case ID_CLASS: case ID_JUNK: break; case ID_ATTRSET: return id; @@ -10541,7 +10541,7 @@ intern_str(VALUE str) } if (name[last] == '=') { /* attribute assignment */ - if (!rb_enc_symname2_p(name, last, enc)) + if (last > 1 && name[last-1] == '=') goto junk; id = rb_intern3(name, last, enc); if (id > tLAST_OP_ID && !is_attrset_id(id)) { |