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

ruby-changes:45835

From: nobu <ko1@a...>
Date: Sun, 12 Mar 2017 22:51:17 +0900 (JST)
Subject: [ruby-changes:45835] nobu:r57908 (trunk): compile.c: compile_const_prefix

nobu	2017-03-12 22:51:12 +0900 (Sun, 12 Mar 2017)

  New Revision: 57908

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

  Log:
    compile.c: compile_const_prefix
    
    * compile.c (compile_const_prefix): rename, and check the result
      of parts of the prefix.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 57907)
+++ compile.c	(revision 57908)
@@ -3466,23 +3466,23 @@ compile_massign(rb_iseq_t *iseq, LINK_AN https://github.com/ruby/ruby/blob/trunk/compile.c#L3466
 }
 
 static int
-compile_colon2(rb_iseq_t *iseq, NODE *node,
-	       LINK_ANCHOR *const pref, LINK_ANCHOR *const body)
+compile_const_prefix(rb_iseq_t *iseq, NODE *node,
+		     LINK_ANCHOR *const pref, LINK_ANCHOR *const body)
 {
     switch (nd_type(node)) {
       case NODE_CONST:
-	debugi("compile_colon2 - colon", node->nd_vid);
+	debugi("compile_const_prefix - colon", node->nd_vid);
 	ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_vid));
 	break;
       case NODE_COLON3:
-	debugi("compile_colon2 - colon3", node->nd_mid);
+	debugi("compile_const_prefix - colon3", node->nd_mid);
 	ADD_INSN(body, nd_line(node), pop);
 	ADD_INSN1(body, nd_line(node), putobject, rb_cObject);
 	ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
 	break;
       case NODE_COLON2:
-	compile_colon2(iseq, node->nd_head, pref, body);
-	debugi("compile_colon2 - colon2", node->nd_mid);
+	CHECK(compile_const_prefix(iseq, node->nd_head, pref, body));
+	debugi("compile_const_prefix - colon2", node->nd_mid);
 	ADD_INSN1(body, nd_line(node), getconstant, ID2SYM(node->nd_mid));
 	break;
       default:
@@ -6019,7 +6019,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK https://github.com/ruby/ruby/blob/trunk/compile.c#L6019
 
 	    INIT_ANCHOR(pref);
 	    INIT_ANCHOR(body);
-	    compile_colon2(iseq, node, pref, body);
+	    CHECK(compile_const_prefix(iseq, node, pref, body));
 	    if (LIST_SIZE_ZERO(pref)) {
 		if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) {
 		    ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index));

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

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