diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-08-26 14:54:04 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-08-26 14:54:04 +0000 |
commit | 401da7918827a75a737c023ee11631792bc908ca (patch) | |
tree | ede8da777156943eda9ebaec78c8c1119c14af47 /parse.y | |
parent | 235e64c2474d40789d39306dda1cc415310a50b0 (diff) |
merge revision(s) d0ba4abf1a00339ebbb5d405db3240a8bdb7b68b,54eac83b2ad77ddea84fa6d66c09e0bb014cf61e: [Backport #15786]
Add RB_ID_SERIAL_MAX
Hide internal IDs
* parse.y (internal_id): number the ID serial for internal use by
counting down from the neary maximum value, not to accidentally
match permanent IDs.
[Bug #15768]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -11583,8 +11583,9 @@ rb_init_parse(void) static ID internal_id_gen(struct parser_params *parser) { + const ID max_id = RB_ID_SERIAL_MAX & ~0xffff; ID id = (ID)vtable_size(lvtbl->args) + (ID)vtable_size(lvtbl->vars); - id += ((tLAST_TOKEN - ID_INTERNAL) >> ID_SCOPE_SHIFT) + 1; + id = max_id - id; return ID_STATIC_SYM | ID_INTERNAL | (id << ID_SCOPE_SHIFT); } |