[前][次][番号順一覧][スレッド一覧]

ruby-changes:33685

From: nobu <ko1@a...>
Date: Thu, 1 May 2014 00:25:51 +0900 (JST)
Subject: [ruby-changes:33685] nobu:r45766 (trunk): parse.y: raise with numeric ID type

nobu	2014-05-01 00:25:46 +0900 (Thu, 01 May 2014)

  New Revision: 45766

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45766

  Log:
    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.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 45765)
+++ parse.y	(revision 45766)
@@ -8815,17 +8815,6 @@ block_dup_check_gen(struct parser_params https://github.com/ruby/ruby/blob/trunk/parse.y#L8815
     }
 }
 
-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) https://github.com/ruby/ruby/blob/trunk/parse.y#L8838
 	  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) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]