control flow construction: creation of unbound labels in when fixed

This commit is contained in:
svtk
2012-01-18 14:34:28 +04:00
parent c256bdb44f
commit cbcfeaa1b7
@@ -750,7 +750,7 @@ public class JetControlFlowProcessor {
Label doneLabel = builder.createUnboundLabel();
Label nextLabel = builder.createUnboundLabel();
Label nextLabel = null;
for (Iterator<JetWhenEntry> iterator = expression.getEntries().iterator(); iterator.hasNext(); ) {
JetWhenEntry whenEntry = iterator.next();
@@ -779,6 +779,7 @@ public class JetControlFlowProcessor {
}
if (!isIrrefutable) {
nextLabel = builder.createUnboundLabel();
builder.nondeterministicJump(nextLabel);
}
@@ -786,8 +787,10 @@ public class JetControlFlowProcessor {
value(whenEntry.getExpression(), inCondition);
builder.allowDead();
builder.jump(doneLabel);
builder.bindLabel(nextLabel);
nextLabel = builder.createUnboundLabel();
if (!isIrrefutable) {
builder.bindLabel(nextLabel);
}
}
builder.bindLabel(doneLabel);
if (!hasElseOrIrrefutableBranch) {