summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-08 05:17:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-08 05:17:09 +0000
commitdc0dc6483a4a4c0e7168a184706695d1263c422c (patch)
treeb8c85e67cb8e0e7030c2a55477fad3043ff0f7ec
parent51e6e260168eeeb0675327d410c8215b119c50f5 (diff)
compile.c: compile_case2 branch
* compile.c (compile_case2): compile as a branch condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--compile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 65e06d3e6c..9357835379 100644
--- a/compile.c
+++ b/compile.c
@@ -4845,9 +4845,12 @@ compile_case2(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_no
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;