Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -1131,8 +1131,12 @@ public Operand buildCase(CaseNode caseNode) {
} else {
Operand expression = buildWithOrder(whenNode.getExpressionNodes(), whenNode.containsVariableAssignment());

addInstr(new EQQInstr(eqqResult, expression, value));
v1 = eqqResult;
if (value != UndefinedValue.UNDEFINED) {
addInstr(new EQQInstr(eqqResult, expression, value));
v1 = eqqResult;
} else {
v1 = expression;
}
v2 = manager.getTrue();
}
addInstr(BEQInstr.create(v1, v2, bodyLabel));

0 comments on commit cf4145c

Please sign in to comment.