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

ruby-changes:49559

From: nobu <ko1@a...>
Date: Mon, 8 Jan 2018 14:17:16 +0900 (JST)
Subject: [ruby-changes:49559] nobu:r61675 (trunk): compile.c: compile_case2 branch

nobu	2018-01-08 14:17:09 +0900 (Mon, 08 Jan 2018)

  New Revision: 61675

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

  Log:
    compile.c: compile_case2 branch
    
    * compile.c (compile_case2): compile as a branch condition.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 61674)
+++ compile.c	(revision 61675)
@@ -4845,9 +4845,12 @@ compile_case2(rb_iseq_t *iseq, LINK_ANCH https://github.com/ruby/ruby/blob/trunk/compile.c#L4845
 	switch (nd_type(vals)) {
 	  case NODE_ARRAY:
 	    while (vals) {
+		LABEL *lnext;
 		val = vals->nd_head;
-		CHECK(COMPILE(ret, "when2", val));
-		ADD_INSNL(ret, nd_line(val), branchif, l1);
+		lnext = NEW_LABEL(nd_line(val));
+		debug_compile("== when2\n", (void)0);
+		CHECK(compile_branch_condition(iseq, ret, val, l1, lnext));
+		ADD_LABEL(ret, lnext);
 		vals = vals->nd_next;
 	    }
 	    break;

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

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