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

ruby-changes:45699

From: nobu <ko1@a...>
Date: Sat, 4 Mar 2017 23:22:01 +0900 (JST)
Subject: [ruby-changes:45699] nobu:r57772 (trunk): compile.c: fix invalid label message

nobu	2017-03-04 23:21:57 +0900 (Sat, 04 Mar 2017)

  New Revision: 57772

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57772

  Log:
    compile.c: fix invalid label message
    
    * compile.c (validate_label): fix invalid label message.
      registered labels are Symbols, not IDs.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 57771)
+++ compile.c	(revision 57772)
@@ -559,7 +559,7 @@ validate_label(st_data_t name, st_data_t https://github.com/ruby/ruby/blob/trunk/compile.c#L559
 	do {
 	    COMPILE_ERROR(iseq, lobj->position,
 			  "%"PRIsVALUE": undefined label",
-			  rb_id2str((ID)name));
+			  rb_sym2str((VALUE)name));
 	} while (0);
     }
     return ST_CONTINUE;
@@ -5268,7 +5268,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L5268
 		if (nd_type(node->nd_args->nd_head) == NODE_LIT &&
 		    SYMBOL_P(node->nd_args->nd_head->nd_lit)) {
 
-		    label_name = SYM2ID(node->nd_args->nd_head->nd_lit);
+		    label_name = node->nd_args->nd_head->nd_lit;
 		    if (!st_lookup(labels_table, (st_data_t)label_name, &data)) {
 			label = NEW_LABEL(line);
 			label->position = line;

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

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