зеркало из https://github.com/github/ruby.git
parse.y: raise with numeric ID type
* parse.y (rb_id_attrset): all valid ID types are handled properly, raise with numeric ID type which may be broken for GCed static symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
58fdffaa13
Коммит
fba47c1397
16
parse.y
16
parse.y
|
@ -8815,17 +8815,6 @@ block_dup_check_gen(struct parser_params *parser, NODE *node1, NODE *node2)
|
|||
}
|
||||
}
|
||||
|
||||
static const char id_type_names[][9] = {
|
||||
"LOCAL",
|
||||
"INSTANCE",
|
||||
"", /* INSTANCE2 */
|
||||
"GLOBAL",
|
||||
"ATTRSET",
|
||||
"CONST",
|
||||
"CLASS",
|
||||
"JUNK",
|
||||
};
|
||||
|
||||
static ID rb_pin_dynamic_symbol(VALUE);
|
||||
static ID attrsetname_to_attr(VALUE name);
|
||||
|
||||
|
@ -8849,9 +8838,8 @@ rb_id_attrset(ID id)
|
|||
case ID_ATTRSET:
|
||||
return id;
|
||||
default:
|
||||
rb_name_error(id, "cannot make %s ID :%"PRIsVALUE" attrset",
|
||||
id_type_names[scope], rb_id2str(id));
|
||||
|
||||
rb_name_error(id, "cannot make unknown type ID %d:%p attrset",
|
||||
scope, (void *)id);
|
||||
}
|
||||
}
|
||||
if (id&ID_STATIC_SYM) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче