control flow construction: creation of unbound labels in when fixed
This commit is contained in:
@@ -750,7 +750,7 @@ public class JetControlFlowProcessor {
|
|||||||
|
|
||||||
Label doneLabel = builder.createUnboundLabel();
|
Label doneLabel = builder.createUnboundLabel();
|
||||||
|
|
||||||
Label nextLabel = builder.createUnboundLabel();
|
Label nextLabel = null;
|
||||||
for (Iterator<JetWhenEntry> iterator = expression.getEntries().iterator(); iterator.hasNext(); ) {
|
for (Iterator<JetWhenEntry> iterator = expression.getEntries().iterator(); iterator.hasNext(); ) {
|
||||||
JetWhenEntry whenEntry = iterator.next();
|
JetWhenEntry whenEntry = iterator.next();
|
||||||
|
|
||||||
@@ -779,6 +779,7 @@ public class JetControlFlowProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isIrrefutable) {
|
if (!isIrrefutable) {
|
||||||
|
nextLabel = builder.createUnboundLabel();
|
||||||
builder.nondeterministicJump(nextLabel);
|
builder.nondeterministicJump(nextLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -786,8 +787,10 @@ public class JetControlFlowProcessor {
|
|||||||
value(whenEntry.getExpression(), inCondition);
|
value(whenEntry.getExpression(), inCondition);
|
||||||
builder.allowDead();
|
builder.allowDead();
|
||||||
builder.jump(doneLabel);
|
builder.jump(doneLabel);
|
||||||
builder.bindLabel(nextLabel);
|
|
||||||
nextLabel = builder.createUnboundLabel();
|
if (!isIrrefutable) {
|
||||||
|
builder.bindLabel(nextLabel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
builder.bindLabel(doneLabel);
|
builder.bindLabel(doneLabel);
|
||||||
if (!hasElseOrIrrefutableBranch) {
|
if (!hasElseOrIrrefutableBranch) {
|
||||||
|
|||||||
Reference in New Issue
Block a user