diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-04-24 13:35:23 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-04-26 09:33:48 +0900 |
commit | 54eac83b2ad77ddea84fa6d66c09e0bb014cf61e (patch) | |
tree | 01dd78aef4d8a7ee300ff086b8a99e13ef8ecd42 /parse.y | |
parent | 5689c46457e6b078ac83b08b7e881e0050ebdfaa (diff) |
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]
Notes
Notes:
Fixed: [Bug #15786]
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -11812,8 +11812,9 @@ rb_init_parse(void) static ID internal_id(struct parser_params *p) { + const ID max_id = RB_ID_SERIAL_MAX & ~0xffff; ID id = (ID)vtable_size(p->lvtbl->args) + (ID)vtable_size(p->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); } #endif /* !RIPPER */ |