summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-15 14:53:00 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-15 14:53:00 +0000
commitf9acab1f4298f909624440d98996ffe1b7b6da82 (patch)
tree0628d29da1cfce380822fcc89a579fd333eb7c05 /parse.y
parent4f8090c71cca18a8f7c1b923f398cc9d6712f810 (diff)
merge revision(s) r44926: [Backport #8756] [Backport #9248]
* parse.y (IDSET_ATTRSET_FOR_INTERN): fix off-by-one bug. * parse.y (rb_enc_symname_type): junk ID succeeded by '=' is also attrset ID. [ruby-core:60668] [Bug #8756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 9f10260eae..da512a6243 100644
--- a/parse.y
+++ b/parse.y
@@ -10095,7 +10095,7 @@ rb_enc_symname_p(const char *name, rb_encoding *enc)
}
#define IDSET_ATTRSET_FOR_SYNTAX ((1U<<ID_LOCAL)|(1U<<ID_CONST))
-#define IDSET_ATTRSET_FOR_INTERN (~(~0U<<ID_SCOPE_MASK) & ~(1U<<ID_ATTRSET))
+#define IDSET_ATTRSET_FOR_INTERN (~(~0U<<(1<<ID_SCOPE_SHIFT)) & ~(1U<<ID_ATTRSET))
static int
rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int allowed_atttset)
@@ -10181,7 +10181,8 @@ rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int a
if (type == ID_GLOBAL || type == ID_CLASS || type == ID_INSTANCE) return -1;
type = ID_JUNK;
++m;
- break;
+ if (m + 1 < e || *m != '=') break;
+ /* fall through */
case '=':
if (!(allowed_atttset & (1U << type))) return -1;
type = ID_ATTRSET;