summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/compile.c b/compile.c
index 51477e9e20..48b3afd2d7 100644
--- a/compile.c
+++ b/compile.c
@@ -3927,35 +3927,35 @@ compile_branch_condition(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *co
case NODE_LAMBDA:
/* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
ADD_INSNL(ret, nd_line(cond), jump, then_label);
- break;
+ return COMPILE_OK;
case NODE_FALSE:
case NODE_NIL:
/* printf("useless condition eliminate (%s)\n", ruby_node_name(nd_type(cond))); */
ADD_INSNL(ret, nd_line(cond), jump, else_label);
- break;
+ return COMPILE_OK;
case NODE_LIST:
case NODE_ARGSCAT:
case NODE_DREGX:
case NODE_DSTR:
CHECK(COMPILE_POPPED(ret, "branch condition", cond));
ADD_INSNL(ret, nd_line(cond), jump, then_label);
- break;
+ return COMPILE_OK;
case NODE_FLIP2:
CHECK(compile_flip_flop(iseq, ret, cond, TRUE, then_label, else_label));
- break;
+ return COMPILE_OK;
case NODE_FLIP3:
CHECK(compile_flip_flop(iseq, ret, cond, FALSE, then_label, else_label));
- break;
+ return COMPILE_OK;
case NODE_DEFINED:
CHECK(compile_defined_expr(iseq, ret, cond, Qfalse));
- goto branch;
+ break;
default:
CHECK(COMPILE(ret, "branch condition", cond));
- branch:
- ADD_INSNL(ret, nd_line(cond), branchunless, else_label);
- ADD_INSNL(ret, nd_line(cond), jump, then_label);
- break;
+ break;
}
+
+ ADD_INSNL(ret, nd_line(cond), branchunless, else_label);
+ ADD_INSNL(ret, nd_line(cond), jump, then_label);
return COMPILE_OK;
}