From fba47c139755b1004301d5dcf44c77b3bc3f111e Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 30 Apr 2014 15:25:46 +0000 Subject: 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 --- parse.y | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/parse.y b/parse.y index 26383a45b7..935b4c241b 100644 --- a/parse.y +++ b/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) { -- cgit v1.2.3