From 6496dc892dac58dc3267872c7a1f04bb7843dce3 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 29 Sep 2013 14:45:46 +0000 Subject: 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 --- parse.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 1f2eea9ca8..5ae81267e3 100644 --- a/parse.y +++ b/parse.y @@ -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)) { -- cgit v1.2.3