Report 'break or continue outside a loop'
for break/continue outside a loop body (e.g. in loop condition) #KT-5724 Fixed
This commit is contained in:
@@ -19,19 +19,24 @@ package org.jetbrains.jet.lang.cfg;
|
|||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import org.jetbrains.jet.lang.psi.JetElement;
|
import org.jetbrains.jet.lang.psi.JetElement;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class BreakableBlockInfo extends BlockInfo {
|
public class BreakableBlockInfo extends BlockInfo {
|
||||||
private final JetElement element;
|
private final JetElement element;
|
||||||
private final Label entryPoint;
|
private final Label entryPoint;
|
||||||
private final Label exitPoint;
|
private final Label exitPoint;
|
||||||
protected final Set<Label> referablePoints;
|
private final Set<Label> referablePoints = Sets.newHashSet();
|
||||||
|
|
||||||
public BreakableBlockInfo(JetElement element, Label entryPoint, Label exitPoint) {
|
public BreakableBlockInfo(JetElement element, Label entryPoint, Label exitPoint) {
|
||||||
this.element = element;
|
this.element = element;
|
||||||
this.entryPoint = entryPoint;
|
this.entryPoint = entryPoint;
|
||||||
this.exitPoint = exitPoint;
|
this.exitPoint = exitPoint;
|
||||||
referablePoints = Sets.newHashSet(entryPoint, exitPoint);
|
markReferablePoints(entryPoint, exitPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void markReferablePoints(Label... labels) {
|
||||||
|
Collections.addAll(referablePoints, labels);
|
||||||
}
|
}
|
||||||
|
|
||||||
public JetElement getElement() {
|
public JetElement getElement() {
|
||||||
|
|||||||
@@ -82,11 +82,12 @@ public interface JetControlFlowBuilder {
|
|||||||
void throwException(@NotNull JetThrowExpression throwExpression, @NotNull PseudoValue thrownValue);
|
void throwException(@NotNull JetThrowExpression throwExpression, @NotNull PseudoValue thrownValue);
|
||||||
|
|
||||||
// Loops
|
// Loops
|
||||||
LoopInfo enterLoop(@NotNull JetExpression expression, @Nullable Label loopExitPoint, @Nullable Label conditionEntryPoint);
|
@NotNull
|
||||||
|
LoopInfo enterLoop(@NotNull JetLoopExpression expression);
|
||||||
void exitLoop(@NotNull JetExpression expression);
|
void enterLoopBody(@NotNull JetLoopExpression expression);
|
||||||
|
void exitLoopBody(@NotNull JetLoopExpression expression);
|
||||||
@Nullable
|
@Nullable
|
||||||
JetElement getCurrentLoop();
|
JetLoopExpression getCurrentLoop();
|
||||||
|
|
||||||
// Try-Finally
|
// Try-Finally
|
||||||
void enterTryFinally(@NotNull GenerationTrigger trigger);
|
void enterTryFinally(@NotNull GenerationTrigger trigger);
|
||||||
|
|||||||
@@ -189,19 +189,25 @@ public abstract class JetControlFlowBuilderAdapter implements JetControlFlowBuil
|
|||||||
return getDelegateBuilder().getConditionEntryPoint(labelElement);
|
return getDelegateBuilder().getConditionEntryPoint(labelElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public LoopInfo enterLoop(@NotNull JetExpression expression, @Nullable Label loopExitPoint, Label conditionEntryPoint) {
|
public LoopInfo enterLoop(@NotNull JetLoopExpression expression) {
|
||||||
return getDelegateBuilder().enterLoop(expression, loopExitPoint, conditionEntryPoint);
|
return getDelegateBuilder().enterLoop(expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exitLoop(@NotNull JetExpression expression) {
|
public void enterLoopBody(@NotNull JetLoopExpression expression) {
|
||||||
getDelegateBuilder().exitLoop(expression);
|
getDelegateBuilder().enterLoopBody(expression);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exitLoopBody(@NotNull JetLoopExpression expression) {
|
||||||
|
getDelegateBuilder().exitLoopBody(expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public JetElement getCurrentLoop() {
|
public JetLoopExpression getCurrentLoop() {
|
||||||
return getDelegateBuilder().getCurrentLoop();
|
return getDelegateBuilder().getCurrentLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import org.jetbrains.jet.lang.resolve.BindingContext;
|
|||||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||||
import org.jetbrains.jet.lang.resolve.CompileTimeConstantUtils;
|
import org.jetbrains.jet.lang.resolve.CompileTimeConstantUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage;
|
|
||||||
import org.jetbrains.jet.lang.resolve.calls.model.*;
|
import org.jetbrains.jet.lang.resolve.calls.model.*;
|
||||||
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
@@ -801,7 +800,7 @@ public class JetControlFlowProcessor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visitWhileExpression(@NotNull JetWhileExpression expression) {
|
public void visitWhileExpression(@NotNull JetWhileExpression expression) {
|
||||||
LoopInfo loopInfo = builder.enterLoop(expression, null, null);
|
LoopInfo loopInfo = builder.enterLoop(expression);
|
||||||
|
|
||||||
builder.bindLabel(loopInfo.getConditionEntryPoint());
|
builder.bindLabel(loopInfo.getConditionEntryPoint());
|
||||||
JetExpression condition = expression.getCondition();
|
JetExpression condition = expression.getCondition();
|
||||||
@@ -821,13 +820,14 @@ public class JetControlFlowProcessor {
|
|||||||
builder.magic(condition, null, values, typePredicates, MagicKind.VALUE_CONSUMER);
|
builder.magic(condition, null, values, typePredicates, MagicKind.VALUE_CONSUMER);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.bindLabel(loopInfo.getBodyEntryPoint());
|
builder.enterLoopBody(expression);
|
||||||
JetExpression body = expression.getBody();
|
JetExpression body = expression.getBody();
|
||||||
if (body != null) {
|
if (body != null) {
|
||||||
generateInstructions(body);
|
generateInstructions(body);
|
||||||
}
|
}
|
||||||
builder.jump(loopInfo.getEntryPoint(), expression);
|
builder.jump(loopInfo.getEntryPoint(), expression);
|
||||||
builder.exitLoop(expression);
|
builder.exitLoopBody(expression);
|
||||||
|
builder.bindLabel(loopInfo.getExitPoint());
|
||||||
builder.loadUnit(expression);
|
builder.loadUnit(expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -835,20 +835,21 @@ public class JetControlFlowProcessor {
|
|||||||
public void visitDoWhileExpression(@NotNull JetDoWhileExpression expression) {
|
public void visitDoWhileExpression(@NotNull JetDoWhileExpression expression) {
|
||||||
builder.enterLexicalScope(expression);
|
builder.enterLexicalScope(expression);
|
||||||
mark(expression);
|
mark(expression);
|
||||||
LoopInfo loopInfo = builder.enterLoop(expression, null, null);
|
LoopInfo loopInfo = builder.enterLoop(expression);
|
||||||
|
|
||||||
builder.bindLabel(loopInfo.getBodyEntryPoint());
|
builder.enterLoopBody(expression);
|
||||||
JetExpression body = expression.getBody();
|
JetExpression body = expression.getBody();
|
||||||
if (body != null) {
|
if (body != null) {
|
||||||
generateInstructions(body);
|
generateInstructions(body);
|
||||||
}
|
}
|
||||||
|
builder.exitLoopBody(expression);
|
||||||
builder.bindLabel(loopInfo.getConditionEntryPoint());
|
builder.bindLabel(loopInfo.getConditionEntryPoint());
|
||||||
JetExpression condition = expression.getCondition();
|
JetExpression condition = expression.getCondition();
|
||||||
if (condition != null) {
|
if (condition != null) {
|
||||||
generateInstructions(condition);
|
generateInstructions(condition);
|
||||||
}
|
}
|
||||||
builder.jumpOnTrue(loopInfo.getEntryPoint(), expression, builder.getBoundValue(condition));
|
builder.jumpOnTrue(loopInfo.getEntryPoint(), expression, builder.getBoundValue(condition));
|
||||||
builder.exitLoop(expression);
|
builder.bindLabel(loopInfo.getExitPoint());
|
||||||
builder.loadUnit(expression);
|
builder.loadUnit(expression);
|
||||||
builder.exitLexicalScope(expression);
|
builder.exitLexicalScope(expression);
|
||||||
}
|
}
|
||||||
@@ -864,26 +865,24 @@ public class JetControlFlowProcessor {
|
|||||||
declareLoopParameter(expression);
|
declareLoopParameter(expression);
|
||||||
|
|
||||||
// TODO : primitive cases
|
// TODO : primitive cases
|
||||||
Label loopExitPoint = builder.createUnboundLabel("'for' loop exit point");
|
LoopInfo loopInfo = builder.enterLoop(expression);
|
||||||
Label conditionEntryPoint = builder.createUnboundLabel("'for' loop condition entry point");
|
|
||||||
|
|
||||||
builder.bindLabel(conditionEntryPoint);
|
builder.bindLabel(loopInfo.getConditionEntryPoint());
|
||||||
builder.nondeterministicJump(loopExitPoint, expression, null);
|
builder.nondeterministicJump(loopInfo.getExitPoint(), expression, null);
|
||||||
|
|
||||||
LoopInfo loopInfo = builder.enterLoop(expression, loopExitPoint, conditionEntryPoint);
|
|
||||||
|
|
||||||
builder.bindLabel(loopInfo.getBodyEntryPoint());
|
|
||||||
writeLoopParameterAssignment(expression);
|
writeLoopParameterAssignment(expression);
|
||||||
|
|
||||||
mark(expression);
|
mark(expression);
|
||||||
|
builder.enterLoopBody(expression);
|
||||||
JetExpression body = expression.getBody();
|
JetExpression body = expression.getBody();
|
||||||
if (body != null) {
|
if (body != null) {
|
||||||
generateInstructions(body);
|
generateInstructions(body);
|
||||||
}
|
}
|
||||||
|
builder.jump(loopInfo.getEntryPoint(), expression);
|
||||||
|
|
||||||
builder.nondeterministicJump(loopInfo.getEntryPoint(), expression, null);
|
builder.exitLoopBody(expression);
|
||||||
|
builder.bindLabel(loopInfo.getExitPoint());
|
||||||
builder.exitLoop(expression);
|
|
||||||
builder.loadUnit(expression);
|
builder.loadUnit(expression);
|
||||||
builder.exitLexicalScope(expression);
|
builder.exitLexicalScope(expression);
|
||||||
}
|
}
|
||||||
@@ -957,9 +956,10 @@ public class JetControlFlowProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private JetElement getCorrespondingLoop(JetExpressionWithLabel expression) {
|
private JetElement getCorrespondingLoop(JetExpressionWithLabel expression) {
|
||||||
String labelName = expression.getLabelName();
|
String labelName = expression.getLabelName();
|
||||||
JetElement loop;
|
JetLoopExpression loop;
|
||||||
if (labelName != null) {
|
if (labelName != null) {
|
||||||
JetSimpleNameExpression targetLabel = expression.getTargetLabel();
|
JetSimpleNameExpression targetLabel = expression.getTargetLabel();
|
||||||
assert targetLabel != null;
|
assert targetLabel != null;
|
||||||
@@ -978,6 +978,12 @@ public class JetControlFlowProcessor {
|
|||||||
trace.report(BREAK_OR_CONTINUE_OUTSIDE_A_LOOP.on(expression));
|
trace.report(BREAK_OR_CONTINUE_OUTSIDE_A_LOOP.on(expression));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (loop != null && loop.getBody() != null
|
||||||
|
// the faster version of 'isAncestor' check:
|
||||||
|
&& !loop.getBody().getTextRange().contains(expression.getTextRange())) {
|
||||||
|
trace.report(BREAK_OR_CONTINUE_OUTSIDE_A_LOOP.on(expression));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return loop;
|
return loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,27 +16,41 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.cfg;
|
package org.jetbrains.jet.lang.cfg;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
import org.jetbrains.jet.lang.psi.JetLoopExpression;
|
||||||
import org.jetbrains.jet.lang.psi.JetElement;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class LoopInfo extends BreakableBlockInfo {
|
public class LoopInfo extends BreakableBlockInfo {
|
||||||
private final Label bodyEntryPoint;
|
private final Label bodyEntryPoint;
|
||||||
|
private final Label bodyExitPoint;
|
||||||
private final Label conditionEntryPoint;
|
private final Label conditionEntryPoint;
|
||||||
|
|
||||||
public LoopInfo(JetElement element, Label entryPoint, Label exitPoint, Label bodyEntryPoint, Label conditionEntryPoint) {
|
public LoopInfo(
|
||||||
super(element, entryPoint, exitPoint);
|
JetLoopExpression loopExpression,
|
||||||
|
Label entryPoint,
|
||||||
|
Label exitPoint,
|
||||||
|
Label bodyEntryPoint,
|
||||||
|
Label bodyExitPoint,
|
||||||
|
Label conditionEntryPoint
|
||||||
|
) {
|
||||||
|
super(loopExpression, entryPoint, exitPoint);
|
||||||
this.bodyEntryPoint = bodyEntryPoint;
|
this.bodyEntryPoint = bodyEntryPoint;
|
||||||
|
this.bodyExitPoint = bodyExitPoint;
|
||||||
this.conditionEntryPoint = conditionEntryPoint;
|
this.conditionEntryPoint = conditionEntryPoint;
|
||||||
referablePoints.add(bodyEntryPoint);
|
markReferablePoints(bodyEntryPoint, bodyExitPoint, conditionEntryPoint);
|
||||||
referablePoints.add(conditionEntryPoint);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JetLoopExpression getElement() {
|
||||||
|
return (JetLoopExpression) super.getElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Label getBodyEntryPoint() {
|
public Label getBodyEntryPoint() {
|
||||||
return bodyEntryPoint;
|
return bodyEntryPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Label getBodyExitPoint() {
|
||||||
|
return bodyExitPoint;
|
||||||
|
}
|
||||||
|
|
||||||
public Label getConditionEntryPoint() {
|
public Label getConditionEntryPoint() {
|
||||||
return conditionEntryPoint;
|
return conditionEntryPoint;
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-14
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.cfg.pseudocode;
|
package org.jetbrains.jet.lang.cfg.pseudocode;
|
||||||
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import com.intellij.util.containers.Stack;
|
import com.intellij.util.containers.Stack;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -39,7 +38,7 @@ import java.util.*;
|
|||||||
public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAdapter {
|
public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAdapter {
|
||||||
private JetControlFlowBuilder builder = null;
|
private JetControlFlowBuilder builder = null;
|
||||||
|
|
||||||
private final Stack<BreakableBlockInfo> loopInfo = new Stack<BreakableBlockInfo>();
|
private final Stack<LoopInfo> loopInfo = new Stack<LoopInfo>();
|
||||||
private final Stack<LexicalScope> lexicalScopes = new Stack<LexicalScope>();
|
private final Stack<LexicalScope> lexicalScopes = new Stack<LexicalScope>();
|
||||||
private final Map<JetElement, BreakableBlockInfo> elementToBlockInfo = new HashMap<JetElement, BreakableBlockInfo>();
|
private final Map<JetElement, BreakableBlockInfo> elementToBlockInfo = new HashMap<JetElement, BreakableBlockInfo>();
|
||||||
private int labelCount = 0;
|
private int labelCount = 0;
|
||||||
@@ -143,33 +142,40 @@ public class JetControlFlowInstructionsGenerator extends JetControlFlowBuilderAd
|
|||||||
return pseudocode.createLabel("L" + labelCount++ + " [" + name + "]");
|
return pseudocode.createLabel("L" + labelCount++ + " [" + name + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public final LoopInfo enterLoop(@NotNull JetExpression expression, @Nullable Label loopExitPoint, Label conditionEntryPoint) {
|
public final LoopInfo enterLoop(@NotNull JetLoopExpression expression) {
|
||||||
Label loopEntryLabel = createUnboundLabel("loop entry point");
|
Label loopEntryLabel = createUnboundLabel("loop entry point");
|
||||||
bindLabel(loopEntryLabel);
|
bindLabel(loopEntryLabel);
|
||||||
LoopInfo blockInfo = new LoopInfo(
|
LoopInfo blockInfo = new LoopInfo(
|
||||||
expression,
|
expression,
|
||||||
loopEntryLabel,
|
loopEntryLabel,
|
||||||
loopExitPoint != null ? loopExitPoint : createUnboundLabel("loop exit point"),
|
createUnboundLabel("loop exit point"),
|
||||||
createUnboundLabel("body entry point"),
|
createUnboundLabel("body entry point"),
|
||||||
conditionEntryPoint != null ? conditionEntryPoint : createUnboundLabel("condition entry point"));
|
createUnboundLabel("body exit point"),
|
||||||
loopInfo.push(blockInfo);
|
createUnboundLabel("condition entry point"));
|
||||||
elementToBlockInfo.put(expression, blockInfo);
|
elementToBlockInfo.put(expression, blockInfo);
|
||||||
allBlocks.push(blockInfo);
|
|
||||||
pseudocode.recordLoopInfo(expression, blockInfo);
|
|
||||||
return blockInfo;
|
return blockInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void exitLoop(@NotNull JetExpression expression) {
|
public void enterLoopBody(@NotNull JetLoopExpression expression) {
|
||||||
BreakableBlockInfo info = loopInfo.pop();
|
LoopInfo info = (LoopInfo) elementToBlockInfo.get(expression);
|
||||||
elementToBlockInfo.remove(expression);
|
bindLabel(info.getBodyEntryPoint());
|
||||||
allBlocks.pop();
|
loopInfo.push(info);
|
||||||
bindLabel(info.getExitPoint());
|
allBlocks.push(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JetElement getCurrentLoop() {
|
public final void exitLoopBody(@NotNull JetLoopExpression expression) {
|
||||||
|
LoopInfo info = loopInfo.pop();
|
||||||
|
elementToBlockInfo.remove(expression);
|
||||||
|
allBlocks.pop();
|
||||||
|
bindLabel(info.getBodyExitPoint());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JetLoopExpression getCurrentLoop() {
|
||||||
return loopInfo.empty() ? null : loopInfo.peek().getElement();
|
return loopInfo.empty() ? null : loopInfo.peek().getElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,8 +101,7 @@ public class PseudocodeImpl implements Pseudocode {
|
|||||||
private Set<LocalFunctionDeclarationInstruction> localDeclarations = null;
|
private Set<LocalFunctionDeclarationInstruction> localDeclarations = null;
|
||||||
//todo getters
|
//todo getters
|
||||||
private final Map<JetElement, Instruction> representativeInstructions = new HashMap<JetElement, Instruction>();
|
private final Map<JetElement, Instruction> representativeInstructions = new HashMap<JetElement, Instruction>();
|
||||||
private final Map<JetExpression, LoopInfo> loopInfo = Maps.newHashMap();
|
|
||||||
|
|
||||||
private final List<PseudocodeLabel> labels = new ArrayList<PseudocodeLabel>();
|
private final List<PseudocodeLabel> labels = new ArrayList<PseudocodeLabel>();
|
||||||
|
|
||||||
private final JetElement correspondingElement;
|
private final JetElement correspondingElement;
|
||||||
@@ -245,10 +244,6 @@ public class PseudocodeImpl implements Pseudocode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ void recordLoopInfo(JetExpression expression, LoopInfo blockInfo) {
|
|
||||||
loopInfo.put(expression, blockInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public SubroutineExitInstruction getExitInstruction() {
|
public SubroutineExitInstruction getExitInstruction() {
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ L0:
|
|||||||
2 mark({ for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue } }) INIT: in: {numbers=ID} out: {numbers=ID} USE: in: {numbers=READ} out: {numbers=READ}
|
2 mark({ for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue } }) INIT: in: {numbers=ID} out: {numbers=ID} USE: in: {numbers=READ} out: {numbers=READ}
|
||||||
3 r(numbers) -> <v1> USE: in: {} out: {numbers=READ}
|
3 r(numbers) -> <v1> USE: in: {} out: {numbers=READ}
|
||||||
v(i) INIT: in: {numbers=ID} out: {i=D, numbers=ID}
|
v(i) INIT: in: {numbers=ID} out: {i=D, numbers=ID}
|
||||||
L3 ['for' loop condition entry point]:
|
L2 [loop entry point]:
|
||||||
jmp?(L2 ['for' loop exit point]) INIT: in: {i=D, numbers=ID} out: {i=D, numbers=ID}
|
L6 [condition entry point]:
|
||||||
L4 [loop entry point]:
|
jmp?(L3 [loop exit point]) INIT: in: {i=D, numbers=ID} out: {i=D, numbers=ID}
|
||||||
L5 [body entry point]:
|
|
||||||
magic[LOOP_RANGE_ITERATION](numbers|<v1>) -> <v2>
|
magic[LOOP_RANGE_ITERATION](numbers|<v1>) -> <v2>
|
||||||
w(i|<v2>) INIT: in: {i=D, numbers=ID} out: {i=ID, numbers=ID}
|
w(i|<v2>) INIT: in: {i=D, numbers=ID} out: {i=ID, numbers=ID}
|
||||||
mark(for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue }) INIT: in: {i=ID, numbers=ID} out: {i=ID, numbers=ID} USE: in: {} out: {}
|
mark(for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue }) INIT: in: {i=ID, numbers=ID} out: {i=ID, numbers=ID} USE: in: {} out: {}
|
||||||
|
L4 [body entry point]:
|
||||||
4 mark({ val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue })
|
4 mark({ val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue })
|
||||||
v(val b: Boolean) INIT: in: {i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
|
v(val b: Boolean) INIT: in: {i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
|
||||||
mark(if (1 < 2) { b = false } else { b = true }) INIT: in: {b=D, i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
|
mark(if (1 < 2) { b = false } else { b = true }) INIT: in: {b=D, i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
|
||||||
@@ -35,23 +35,24 @@ L5 [body entry point]:
|
|||||||
r(2) -> <v4>
|
r(2) -> <v4>
|
||||||
mark(1 < 2)
|
mark(1 < 2)
|
||||||
call(1 < 2, compareTo|<v3>, <v4>) -> <v5>
|
call(1 < 2, compareTo|<v3>, <v4>) -> <v5>
|
||||||
jf(L6 [else branch]|<v5>)
|
jf(L7 [else branch]|<v5>)
|
||||||
5 mark({ b = false })
|
5 mark({ b = false })
|
||||||
r(false) -> <v6> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
|
r(false) -> <v6> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
|
||||||
w(b|<v6>) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
|
w(b|<v6>) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
|
||||||
4 jmp(L7 ['if' expression result]) INIT: in: {b=ID, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=READ}
|
4 jmp(L8 ['if' expression result]) INIT: in: {b=ID, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=READ}
|
||||||
L6 [else branch]:
|
L7 [else branch]:
|
||||||
5 mark({ b = true }) INIT: in: {b=D, i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
|
5 mark({ b = true }) INIT: in: {b=D, i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
|
||||||
r(true) -> <v8> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
|
r(true) -> <v8> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
|
||||||
w(b|<v8>) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
|
w(b|<v8>) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
|
||||||
L7 ['if' expression result]:
|
L8 ['if' expression result]:
|
||||||
4 merge(if (1 < 2) { b = false } else { b = true }|!<v7>, !<v9>) -> <v10> INIT: in: {b=ID, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=READ}
|
4 merge(if (1 < 2) { b = false } else { b = true }|!<v7>, !<v9>) -> <v10> INIT: in: {b=ID, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=READ}
|
||||||
r(b) -> <v11> USE: in: {} out: {b=READ}
|
r(b) -> <v11> USE: in: {} out: {b=READ}
|
||||||
mark(use(b))
|
mark(use(b))
|
||||||
call(use(b), use|<v11>) -> <v12>
|
call(use(b), use|<v11>) -> <v12>
|
||||||
jmp(L3 ['for' loop condition entry point]) USE: in: {} out: {}
|
jmp(L6 [condition entry point]) USE: in: {} out: {}
|
||||||
- 3 jmp?(L4 [loop entry point])
|
- 3 jmp(L2 [loop entry point])
|
||||||
L2 ['for' loop exit point]:
|
L3 [loop exit point]:
|
||||||
|
L5 [body exit point]:
|
||||||
read (Unit) INIT: in: {i=D, numbers=ID} out: {i=D, numbers=ID}
|
read (Unit) INIT: in: {i=D, numbers=ID} out: {i=D, numbers=ID}
|
||||||
L1:
|
L1:
|
||||||
1 <END> INIT: in: {numbers=ID} out: {numbers=ID}
|
1 <END> INIT: in: {numbers=ID} out: {numbers=ID}
|
||||||
@@ -76,4 +77,4 @@ error:
|
|||||||
<ERROR> INIT: in: {} out: {}
|
<ERROR> INIT: in: {} out: {}
|
||||||
sink:
|
sink:
|
||||||
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
|
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
|
||||||
=====================
|
=====================
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ L4 [body entry point]:
|
|||||||
v(var a = 2)
|
v(var a = 2)
|
||||||
r(2) -> <v1>
|
r(2) -> <v1>
|
||||||
w(a|<v1>)
|
w(a|<v1>)
|
||||||
L5 [condition entry point]:
|
L5 [body exit point]:
|
||||||
|
L6 [condition entry point]:
|
||||||
r(a) -> <v2>
|
r(a) -> <v2>
|
||||||
r(0) -> <v3>
|
r(0) -> <v3>
|
||||||
mark(a > 0)
|
mark(a > 0)
|
||||||
|
|||||||
@@ -17,19 +17,20 @@ L0:
|
|||||||
mark(1..10)
|
mark(1..10)
|
||||||
call(1..10, rangeTo|<v1>, <v2>) -> <v3>
|
call(1..10, rangeTo|<v1>, <v2>) -> <v3>
|
||||||
v(i) INIT: in: {} out: {i=D}
|
v(i) INIT: in: {} out: {i=D}
|
||||||
L3 ['for' loop condition entry point]:
|
L2 [loop entry point]:
|
||||||
jmp?(L2 ['for' loop exit point]) INIT: in: {i=D} out: {i=D}
|
L6 [condition entry point]:
|
||||||
L4 [loop entry point]:
|
jmp?(L3 [loop exit point]) INIT: in: {i=D} out: {i=D}
|
||||||
L5 [body entry point]:
|
|
||||||
magic[LOOP_RANGE_ITERATION](1..10|<v3>) -> <v4>
|
magic[LOOP_RANGE_ITERATION](1..10|<v3>) -> <v4>
|
||||||
w(i|<v4>) INIT: in: {i=D} out: {i=ID}
|
w(i|<v4>) INIT: in: {i=D} out: {i=ID}
|
||||||
mark(for (i in 1..10) { val a = i }) INIT: in: {i=ID} out: {i=ID}
|
mark(for (i in 1..10) { val a = i }) INIT: in: {i=ID} out: {i=ID}
|
||||||
|
L4 [body entry point]:
|
||||||
4 mark({ val a = i })
|
4 mark({ val a = i })
|
||||||
v(val a = i) INIT: in: {i=ID} out: {a=D, i=ID}
|
v(val a = i) INIT: in: {i=ID} out: {a=D, i=ID}
|
||||||
r(i) -> <v5> INIT: in: {a=D, i=ID} out: {a=D, i=ID}
|
r(i) -> <v5> INIT: in: {a=D, i=ID} out: {a=D, i=ID}
|
||||||
w(a|<v5>) INIT: in: {a=D, i=ID} out: {a=ID, i=ID}
|
w(a|<v5>) INIT: in: {a=D, i=ID} out: {a=ID, i=ID}
|
||||||
3 jmp?(L4 [loop entry point]) INIT: in: {i=ID} out: {i=ID} USE: in: {i=READ} out: {i=READ}
|
3 jmp(L2 [loop entry point]) INIT: in: {i=ID} out: {i=ID} USE: in: {i=READ} out: {i=READ}
|
||||||
L2 ['for' loop exit point]:
|
L3 [loop exit point]:
|
||||||
|
L5 [body exit point]:
|
||||||
read (Unit) INIT: in: {i=D} out: {i=D}
|
read (Unit) INIT: in: {i=D} out: {i=D}
|
||||||
2 mark("after") INIT: in: {} out: {}
|
2 mark("after") INIT: in: {} out: {}
|
||||||
r("after") -> <v6>
|
r("after") -> <v6>
|
||||||
@@ -39,4 +40,4 @@ error:
|
|||||||
<ERROR>
|
<ERROR>
|
||||||
sink:
|
sink:
|
||||||
<SINK> USE: in: {} out: {}
|
<SINK> USE: in: {} out: {}
|
||||||
=====================
|
=====================
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ L0:
|
|||||||
mark("before")
|
mark("before")
|
||||||
r("before") -> <v0>
|
r("before") -> <v0>
|
||||||
L2 [loop entry point]:
|
L2 [loop entry point]:
|
||||||
L5 [condition entry point]:
|
L6 [condition entry point]:
|
||||||
r(true) -> <v1>
|
r(true) -> <v1>
|
||||||
mark(while (true) { val a: Int })
|
mark(while (true) { val a: Int })
|
||||||
magic[VALUE_CONSUMER](true|<v1>) -> <v2>
|
magic[VALUE_CONSUMER](true|<v1>) -> <v2>
|
||||||
@@ -22,6 +22,7 @@ L4 [body entry point]:
|
|||||||
v(val a: Int) INIT: in: {} out: {a=D}
|
v(val a: Int) INIT: in: {} out: {a=D}
|
||||||
2 jmp(L2 [loop entry point]) INIT: in: {} out: {} USE: in: {} out: {}
|
2 jmp(L2 [loop entry point]) INIT: in: {} out: {} USE: in: {} out: {}
|
||||||
L3 [loop exit point]:
|
L3 [loop exit point]:
|
||||||
|
L5 [body exit point]:
|
||||||
- read (Unit)
|
- read (Unit)
|
||||||
- mark("after")
|
- mark("after")
|
||||||
- r("after") -> <v3>
|
- r("after") -> <v3>
|
||||||
|
|||||||
@@ -15,22 +15,23 @@ L0:
|
|||||||
2 mark({ for (e in c) { { break } } })
|
2 mark({ for (e in c) { { break } } })
|
||||||
3 r(c) -> <v1>
|
3 r(c) -> <v1>
|
||||||
v(e)
|
v(e)
|
||||||
L3 ['for' loop condition entry point]:
|
L2 [loop entry point]:
|
||||||
jmp?(L2 ['for' loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](c|<v1>) -> <v2>]
|
L6 [condition entry point]:
|
||||||
L4 [loop entry point]:
|
jmp?(L3 [loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](c|<v1>) -> <v2>] PREV:[v(e), jmp(L2 [loop entry point])]
|
||||||
L5 [body entry point]:
|
magic[LOOP_RANGE_ITERATION](c|<v1>) -> <v2>
|
||||||
magic[LOOP_RANGE_ITERATION](c|<v1>) -> <v2> PREV:[jmp?(L2 ['for' loop exit point]), jmp?(L4 [loop entry point])]
|
|
||||||
w(e|<v2>)
|
w(e|<v2>)
|
||||||
mark(for (e in c) { { break } })
|
mark(for (e in c) { { break } })
|
||||||
|
L4 [body entry point]:
|
||||||
4 mark({ { break } })
|
4 mark({ { break } })
|
||||||
mark({ break })
|
mark({ break })
|
||||||
jmp?(L6 [after local declaration]) NEXT:[r({ break }) -> <v3>, d({ break })]
|
jmp?(L7 [after local declaration]) NEXT:[r({ break }) -> <v3>, d({ break })]
|
||||||
d({ break }) NEXT:[<SINK>]
|
d({ break }) NEXT:[<SINK>]
|
||||||
L6 [after local declaration]:
|
L7 [after local declaration]:
|
||||||
r({ break }) -> <v3> PREV:[jmp?(L6 [after local declaration])]
|
r({ break }) -> <v3> PREV:[jmp?(L7 [after local declaration])]
|
||||||
3 jmp?(L4 [loop entry point]) NEXT:[magic[LOOP_RANGE_ITERATION](c|<v1>) -> <v2>, read (Unit)]
|
3 jmp(L2 [loop entry point]) NEXT:[jmp?(L3 [loop exit point])]
|
||||||
L2 ['for' loop exit point]:
|
L3 [loop exit point]:
|
||||||
read (Unit) PREV:[jmp?(L2 ['for' loop exit point]), jmp(L2 ['for' loop exit point]), jmp?(L4 [loop entry point])]
|
L5 [body exit point]:
|
||||||
|
read (Unit) PREV:[jmp?(L3 [loop exit point]), jmp(L3 [loop exit point])]
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>]
|
1 <END> NEXT:[<SINK>]
|
||||||
error:
|
error:
|
||||||
@@ -43,15 +44,15 @@ sink:
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
---------------------
|
---------------------
|
||||||
L7:
|
L8:
|
||||||
5 <START>
|
5 <START>
|
||||||
6 mark(break)
|
6 mark(break)
|
||||||
jmp(L2 ['for' loop exit point]) NEXT:[read (Unit)]
|
jmp(L3 [loop exit point]) NEXT:[read (Unit)]
|
||||||
- 5 ret(*|!<v0>) L8 PREV:[]
|
- 5 ret(*|!<v0>) L9 PREV:[]
|
||||||
L8:
|
L9:
|
||||||
<END> NEXT:[<SINK>] PREV:[]
|
<END> NEXT:[<SINK>] PREV:[]
|
||||||
error:
|
error:
|
||||||
<ERROR> PREV:[]
|
<ERROR> PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> PREV:[<ERROR>, <END>]
|
<SINK> PREV:[<ERROR>, <END>]
|
||||||
=====================
|
=====================
|
||||||
|
|||||||
@@ -260,14 +260,14 @@ L0:
|
|||||||
2 mark({ @l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } } })
|
2 mark({ @l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } } })
|
||||||
mark(@l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } })
|
mark(@l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } })
|
||||||
L2 [loop entry point]:
|
L2 [loop entry point]:
|
||||||
L5 [condition entry point]:
|
L6 [condition entry point]:
|
||||||
r(true) -> <v0> PREV:[mark(@l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } }), jmp(L2 [loop entry point])]
|
r(true) -> <v0> PREV:[mark(@l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } }), jmp(L2 [loop entry point])]
|
||||||
mark(while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } })
|
mark(while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } })
|
||||||
magic[VALUE_CONSUMER](true|<v0>) -> <v1>
|
magic[VALUE_CONSUMER](true|<v0>) -> <v1>
|
||||||
L4 [body entry point]:
|
L4 [body entry point]:
|
||||||
3 mark({ try { 1 if (2 > 3) { break @l } } finally { 2 } })
|
3 mark({ try { 1 if (2 > 3) { break @l } } finally { 2 } })
|
||||||
mark(try { 1 if (2 > 3) { break @l } } finally { 2 })
|
mark(try { 1 if (2 > 3) { break @l } } finally { 2 })
|
||||||
jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { break @l } })]
|
jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { break @l } })]
|
||||||
4 mark({ 1 if (2 > 3) { break @l } })
|
4 mark({ 1 if (2 > 3) { break @l } })
|
||||||
r(1) -> <v2>
|
r(1) -> <v2>
|
||||||
mark(if (2 > 3) { break @l })
|
mark(if (2 > 3) { break @l })
|
||||||
@@ -275,29 +275,30 @@ L4 [body entry point]:
|
|||||||
r(3) -> <v4>
|
r(3) -> <v4>
|
||||||
mark(2 > 3)
|
mark(2 > 3)
|
||||||
call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
||||||
jf(L7 [else branch]|<v5>) NEXT:[read (Unit), mark({ break @l })]
|
jf(L8 [else branch]|<v5>) NEXT:[read (Unit), mark({ break @l })]
|
||||||
5 mark({ break @l })
|
5 mark({ break @l })
|
||||||
L8 [start finally]:
|
L9 [start finally]:
|
||||||
6 mark({ 2 })
|
6 mark({ 2 })
|
||||||
r(2) -> <v6>
|
r(2) -> <v6>
|
||||||
L9 [finish finally]:
|
L10 [finish finally]:
|
||||||
5 jmp(L3 [loop exit point]) NEXT:[read (Unit)]
|
5 jmp(L3 [loop exit point]) NEXT:[read (Unit)]
|
||||||
- 4 jmp(L10 ['if' expression result]) NEXT:[merge(if (2 > 3) { break @l }|!<v7>) -> <v8>] PREV:[]
|
- 4 jmp(L11 ['if' expression result]) NEXT:[merge(if (2 > 3) { break @l }|!<v7>) -> <v8>] PREV:[]
|
||||||
L7 [else branch]:
|
L8 [else branch]:
|
||||||
read (Unit) PREV:[jf(L7 [else branch]|<v5>)]
|
read (Unit) PREV:[jf(L8 [else branch]|<v5>)]
|
||||||
L10 ['if' expression result]:
|
L11 ['if' expression result]:
|
||||||
merge(if (2 > 3) { break @l }|!<v7>) -> <v8>
|
merge(if (2 > 3) { break @l }|!<v7>) -> <v8>
|
||||||
3 jmp(L11 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
3 jmp(L12 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
||||||
L6 [onExceptionToFinallyBlock]:
|
L7 [onExceptionToFinallyBlock]:
|
||||||
6 mark({ 2 }) PREV:[jmp?(L6 [onExceptionToFinallyBlock])]
|
6 mark({ 2 }) PREV:[jmp?(L7 [onExceptionToFinallyBlock])]
|
||||||
r(2) -> <v6>
|
r(2) -> <v6>
|
||||||
3 jmp(error) NEXT:[<ERROR>]
|
3 jmp(error) NEXT:[<ERROR>]
|
||||||
L11 [skipFinallyToErrorBlock]:
|
L12 [skipFinallyToErrorBlock]:
|
||||||
6 mark({ 2 }) PREV:[jmp(L11 [skipFinallyToErrorBlock])]
|
6 mark({ 2 }) PREV:[jmp(L12 [skipFinallyToErrorBlock])]
|
||||||
r(2) -> <v6>
|
r(2) -> <v6>
|
||||||
3 merge(try { 1 if (2 > 3) { break @l } } finally { 2 }|<v8>) -> <v9>
|
3 merge(try { 1 if (2 > 3) { break @l } } finally { 2 }|<v8>) -> <v9>
|
||||||
2 jmp(L2 [loop entry point]) NEXT:[r(true) -> <v0>]
|
2 jmp(L2 [loop entry point]) NEXT:[r(true) -> <v0>]
|
||||||
L3 [loop exit point]:
|
L3 [loop exit point]:
|
||||||
|
L5 [body exit point]:
|
||||||
read (Unit) PREV:[jmp(L3 [loop exit point])]
|
read (Unit) PREV:[jmp(L3 [loop exit point])]
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>]
|
1 <END> NEXT:[<SINK>]
|
||||||
@@ -329,7 +330,7 @@ L0:
|
|||||||
3 mark({ @l while(true) { 1 if (2 > 3) { break @l } } 5 })
|
3 mark({ @l while(true) { 1 if (2 > 3) { break @l } } 5 })
|
||||||
mark(@l while(true) { 1 if (2 > 3) { break @l } })
|
mark(@l while(true) { 1 if (2 > 3) { break @l } })
|
||||||
L3 [loop entry point]:
|
L3 [loop entry point]:
|
||||||
L6 [condition entry point]:
|
L7 [condition entry point]:
|
||||||
r(true) -> <v0> PREV:[mark(@l while(true) { 1 if (2 > 3) { break @l } }), jmp(L3 [loop entry point])]
|
r(true) -> <v0> PREV:[mark(@l while(true) { 1 if (2 > 3) { break @l } }), jmp(L3 [loop entry point])]
|
||||||
mark(while(true) { 1 if (2 > 3) { break @l } })
|
mark(while(true) { 1 if (2 > 3) { break @l } })
|
||||||
magic[VALUE_CONSUMER](true|<v0>) -> <v1>
|
magic[VALUE_CONSUMER](true|<v0>) -> <v1>
|
||||||
@@ -341,27 +342,28 @@ L5 [body entry point]:
|
|||||||
r(3) -> <v4>
|
r(3) -> <v4>
|
||||||
mark(2 > 3)
|
mark(2 > 3)
|
||||||
call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
||||||
jf(L7 [else branch]|<v5>) NEXT:[read (Unit), mark({ break @l })]
|
jf(L8 [else branch]|<v5>) NEXT:[read (Unit), mark({ break @l })]
|
||||||
5 mark({ break @l })
|
5 mark({ break @l })
|
||||||
jmp(L4 [loop exit point]) NEXT:[read (Unit)]
|
jmp(L4 [loop exit point]) NEXT:[read (Unit)]
|
||||||
- 4 jmp(L8 ['if' expression result]) NEXT:[merge(if (2 > 3) { break @l }|!<v6>) -> <v7>] PREV:[]
|
- 4 jmp(L9 ['if' expression result]) NEXT:[merge(if (2 > 3) { break @l }|!<v6>) -> <v7>] PREV:[]
|
||||||
L7 [else branch]:
|
L8 [else branch]:
|
||||||
read (Unit) PREV:[jf(L7 [else branch]|<v5>)]
|
read (Unit) PREV:[jf(L8 [else branch]|<v5>)]
|
||||||
L8 ['if' expression result]:
|
L9 ['if' expression result]:
|
||||||
merge(if (2 > 3) { break @l }|!<v6>) -> <v7>
|
merge(if (2 > 3) { break @l }|!<v6>) -> <v7>
|
||||||
3 jmp(L3 [loop entry point]) NEXT:[r(true) -> <v0>]
|
3 jmp(L3 [loop entry point]) NEXT:[r(true) -> <v0>]
|
||||||
L4 [loop exit point]:
|
L4 [loop exit point]:
|
||||||
|
L6 [body exit point]:
|
||||||
read (Unit) PREV:[jmp(L4 [loop exit point])]
|
read (Unit) PREV:[jmp(L4 [loop exit point])]
|
||||||
r(5) -> <v9>
|
r(5) -> <v9>
|
||||||
2 jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
2 jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
||||||
L2 [onExceptionToFinallyBlock]:
|
L2 [onExceptionToFinallyBlock]:
|
||||||
L10 [start finally]:
|
L11 [start finally]:
|
||||||
3 mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
|
3 mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
|
||||||
r(2) -> <v10>
|
r(2) -> <v10>
|
||||||
L11 [finish finally]:
|
L12 [finish finally]:
|
||||||
2 jmp(error) NEXT:[<ERROR>]
|
2 jmp(error) NEXT:[<ERROR>]
|
||||||
L9 [skipFinallyToErrorBlock]:
|
L10 [skipFinallyToErrorBlock]:
|
||||||
3 mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])]
|
3 mark({ 2 }) PREV:[jmp(L10 [skipFinallyToErrorBlock])]
|
||||||
r(2) -> <v10>
|
r(2) -> <v10>
|
||||||
2 merge(try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 }|<v9>) -> <v11>
|
2 merge(try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 }|<v9>) -> <v11>
|
||||||
L1:
|
L1:
|
||||||
@@ -393,7 +395,7 @@ L0:
|
|||||||
3 mark({ @l while(true) { 1 if (2 > 3) { break @l } } })
|
3 mark({ @l while(true) { 1 if (2 > 3) { break @l } } })
|
||||||
mark(@l while(true) { 1 if (2 > 3) { break @l } })
|
mark(@l while(true) { 1 if (2 > 3) { break @l } })
|
||||||
L3 [loop entry point]:
|
L3 [loop entry point]:
|
||||||
L6 [condition entry point]:
|
L7 [condition entry point]:
|
||||||
r(true) -> <v0> PREV:[mark(@l while(true) { 1 if (2 > 3) { break @l } }), jmp(L3 [loop entry point])]
|
r(true) -> <v0> PREV:[mark(@l while(true) { 1 if (2 > 3) { break @l } }), jmp(L3 [loop entry point])]
|
||||||
mark(while(true) { 1 if (2 > 3) { break @l } })
|
mark(while(true) { 1 if (2 > 3) { break @l } })
|
||||||
magic[VALUE_CONSUMER](true|<v0>) -> <v1>
|
magic[VALUE_CONSUMER](true|<v0>) -> <v1>
|
||||||
@@ -405,26 +407,27 @@ L5 [body entry point]:
|
|||||||
r(3) -> <v4>
|
r(3) -> <v4>
|
||||||
mark(2 > 3)
|
mark(2 > 3)
|
||||||
call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
call(2 > 3, compareTo|<v3>, <v4>) -> <v5>
|
||||||
jf(L7 [else branch]|<v5>) NEXT:[read (Unit), mark({ break @l })]
|
jf(L8 [else branch]|<v5>) NEXT:[read (Unit), mark({ break @l })]
|
||||||
5 mark({ break @l })
|
5 mark({ break @l })
|
||||||
jmp(L4 [loop exit point]) NEXT:[read (Unit)]
|
jmp(L4 [loop exit point]) NEXT:[read (Unit)]
|
||||||
- 4 jmp(L8 ['if' expression result]) NEXT:[merge(if (2 > 3) { break @l }|!<v6>) -> <v7>] PREV:[]
|
- 4 jmp(L9 ['if' expression result]) NEXT:[merge(if (2 > 3) { break @l }|!<v6>) -> <v7>] PREV:[]
|
||||||
L7 [else branch]:
|
L8 [else branch]:
|
||||||
read (Unit) PREV:[jf(L7 [else branch]|<v5>)]
|
read (Unit) PREV:[jf(L8 [else branch]|<v5>)]
|
||||||
L8 ['if' expression result]:
|
L9 ['if' expression result]:
|
||||||
merge(if (2 > 3) { break @l }|!<v6>) -> <v7>
|
merge(if (2 > 3) { break @l }|!<v6>) -> <v7>
|
||||||
3 jmp(L3 [loop entry point]) NEXT:[r(true) -> <v0>]
|
3 jmp(L3 [loop entry point]) NEXT:[r(true) -> <v0>]
|
||||||
L4 [loop exit point]:
|
L4 [loop exit point]:
|
||||||
|
L6 [body exit point]:
|
||||||
read (Unit) PREV:[jmp(L4 [loop exit point])]
|
read (Unit) PREV:[jmp(L4 [loop exit point])]
|
||||||
2 jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
2 jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
||||||
L2 [onExceptionToFinallyBlock]:
|
L2 [onExceptionToFinallyBlock]:
|
||||||
L10 [start finally]:
|
L11 [start finally]:
|
||||||
3 mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
|
3 mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
|
||||||
r(2) -> <v9>
|
r(2) -> <v9>
|
||||||
L11 [finish finally]:
|
L12 [finish finally]:
|
||||||
2 jmp(error) NEXT:[<ERROR>]
|
2 jmp(error) NEXT:[<ERROR>]
|
||||||
L9 [skipFinallyToErrorBlock]:
|
L10 [skipFinallyToErrorBlock]:
|
||||||
3 mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])]
|
3 mark({ 2 }) PREV:[jmp(L10 [skipFinallyToErrorBlock])]
|
||||||
r(2) -> <v9>
|
r(2) -> <v9>
|
||||||
2 merge(try { @l while(true) { 1 if (2 > 3) { break @l } } } finally { 2 }|!<v8>) -> <v10>
|
2 merge(try { @l while(true) { 1 if (2 > 3) { break @l } } } finally { 2 }|!<v8>) -> <v10>
|
||||||
L1:
|
L1:
|
||||||
@@ -460,16 +463,16 @@ L0:
|
|||||||
mark(1..a)
|
mark(1..a)
|
||||||
call(1..a, rangeTo|<v1>, <v2>) -> <v3>
|
call(1..a, rangeTo|<v1>, <v2>) -> <v3>
|
||||||
v(i)
|
v(i)
|
||||||
L3 ['for' loop condition entry point]:
|
L2 [loop entry point]:
|
||||||
jmp?(L2 ['for' loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>] PREV:[v(i), jmp(L3 ['for' loop condition entry point])]
|
L6 [condition entry point]:
|
||||||
L4 [loop entry point]:
|
jmp?(L3 [loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>] PREV:[v(i), jmp(L6 [condition entry point]), jmp(L2 [loop entry point])]
|
||||||
L5 [body entry point]:
|
magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>
|
||||||
magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4> PREV:[jmp?(L2 ['for' loop exit point]), jmp?(L4 [loop entry point])]
|
|
||||||
w(i|<v4>)
|
w(i|<v4>)
|
||||||
mark(for (i in 1..a) { try { 1 if (2 > 3) { continue @l } } finally { 2 } })
|
mark(for (i in 1..a) { try { 1 if (2 > 3) { continue @l } } finally { 2 } })
|
||||||
|
L4 [body entry point]:
|
||||||
4 mark({ try { 1 if (2 > 3) { continue @l } } finally { 2 } })
|
4 mark({ try { 1 if (2 > 3) { continue @l } } finally { 2 } })
|
||||||
mark(try { 1 if (2 > 3) { continue @l } } finally { 2 })
|
mark(try { 1 if (2 > 3) { continue @l } } finally { 2 })
|
||||||
jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { continue @l } })]
|
jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { continue @l } })]
|
||||||
5 mark({ 1 if (2 > 3) { continue @l } })
|
5 mark({ 1 if (2 > 3) { continue @l } })
|
||||||
r(1) -> <v5>
|
r(1) -> <v5>
|
||||||
mark(if (2 > 3) { continue @l })
|
mark(if (2 > 3) { continue @l })
|
||||||
@@ -477,30 +480,31 @@ L5 [body entry point]:
|
|||||||
r(3) -> <v7>
|
r(3) -> <v7>
|
||||||
mark(2 > 3)
|
mark(2 > 3)
|
||||||
call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
||||||
jf(L7 [else branch]|<v8>) NEXT:[read (Unit), mark({ continue @l })]
|
jf(L8 [else branch]|<v8>) NEXT:[read (Unit), mark({ continue @l })]
|
||||||
6 mark({ continue @l })
|
6 mark({ continue @l })
|
||||||
L8 [start finally]:
|
L9 [start finally]:
|
||||||
7 mark({ 2 })
|
7 mark({ 2 })
|
||||||
r(2) -> <v9>
|
r(2) -> <v9>
|
||||||
L9 [finish finally]:
|
L10 [finish finally]:
|
||||||
6 jmp(L3 ['for' loop condition entry point]) NEXT:[jmp?(L2 ['for' loop exit point])]
|
6 jmp(L6 [condition entry point]) NEXT:[jmp?(L3 [loop exit point])]
|
||||||
- 5 jmp(L10 ['if' expression result]) NEXT:[merge(if (2 > 3) { continue @l }|!<v10>) -> <v11>] PREV:[]
|
- 5 jmp(L11 ['if' expression result]) NEXT:[merge(if (2 > 3) { continue @l }|!<v10>) -> <v11>] PREV:[]
|
||||||
L7 [else branch]:
|
L8 [else branch]:
|
||||||
read (Unit) PREV:[jf(L7 [else branch]|<v8>)]
|
read (Unit) PREV:[jf(L8 [else branch]|<v8>)]
|
||||||
L10 ['if' expression result]:
|
L11 ['if' expression result]:
|
||||||
merge(if (2 > 3) { continue @l }|!<v10>) -> <v11>
|
merge(if (2 > 3) { continue @l }|!<v10>) -> <v11>
|
||||||
4 jmp(L11 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
4 jmp(L12 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
||||||
L6 [onExceptionToFinallyBlock]:
|
L7 [onExceptionToFinallyBlock]:
|
||||||
7 mark({ 2 }) PREV:[jmp?(L6 [onExceptionToFinallyBlock])]
|
7 mark({ 2 }) PREV:[jmp?(L7 [onExceptionToFinallyBlock])]
|
||||||
r(2) -> <v9>
|
r(2) -> <v9>
|
||||||
4 jmp(error) NEXT:[<ERROR>]
|
4 jmp(error) NEXT:[<ERROR>]
|
||||||
L11 [skipFinallyToErrorBlock]:
|
L12 [skipFinallyToErrorBlock]:
|
||||||
7 mark({ 2 }) PREV:[jmp(L11 [skipFinallyToErrorBlock])]
|
7 mark({ 2 }) PREV:[jmp(L12 [skipFinallyToErrorBlock])]
|
||||||
r(2) -> <v9>
|
r(2) -> <v9>
|
||||||
4 merge(try { 1 if (2 > 3) { continue @l } } finally { 2 }|<v11>) -> <v12>
|
4 merge(try { 1 if (2 > 3) { continue @l } } finally { 2 }|<v11>) -> <v12>
|
||||||
3 jmp?(L4 [loop entry point]) NEXT:[magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>, read (Unit)]
|
3 jmp(L2 [loop entry point]) NEXT:[jmp?(L3 [loop exit point])]
|
||||||
L2 ['for' loop exit point]:
|
L3 [loop exit point]:
|
||||||
read (Unit) PREV:[jmp?(L2 ['for' loop exit point]), jmp?(L4 [loop entry point])]
|
L5 [body exit point]:
|
||||||
|
read (Unit) PREV:[jmp?(L3 [loop exit point])]
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>]
|
1 <END> NEXT:[<SINK>]
|
||||||
error:
|
error:
|
||||||
@@ -538,13 +542,13 @@ L0:
|
|||||||
mark(1..a)
|
mark(1..a)
|
||||||
call(1..a, rangeTo|<v1>, <v2>) -> <v3>
|
call(1..a, rangeTo|<v1>, <v2>) -> <v3>
|
||||||
v(i)
|
v(i)
|
||||||
L4 ['for' loop condition entry point]:
|
L3 [loop entry point]:
|
||||||
jmp?(L3 ['for' loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>] PREV:[v(i), jmp(L4 ['for' loop condition entry point])]
|
L7 [condition entry point]:
|
||||||
L5 [loop entry point]:
|
jmp?(L4 [loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>] PREV:[v(i), jmp(L7 [condition entry point]), jmp(L3 [loop entry point])]
|
||||||
L6 [body entry point]:
|
magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>
|
||||||
magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4> PREV:[jmp?(L3 ['for' loop exit point]), jmp?(L5 [loop entry point])]
|
|
||||||
w(i|<v4>)
|
w(i|<v4>)
|
||||||
mark(for (i in 1..a) { 1 if (2 > 3) { continue @l } })
|
mark(for (i in 1..a) { 1 if (2 > 3) { continue @l } })
|
||||||
|
L5 [body entry point]:
|
||||||
5 mark({ 1 if (2 > 3) { continue @l } })
|
5 mark({ 1 if (2 > 3) { continue @l } })
|
||||||
r(1) -> <v5>
|
r(1) -> <v5>
|
||||||
mark(if (2 > 3) { continue @l })
|
mark(if (2 > 3) { continue @l })
|
||||||
@@ -552,27 +556,28 @@ L6 [body entry point]:
|
|||||||
r(3) -> <v7>
|
r(3) -> <v7>
|
||||||
mark(2 > 3)
|
mark(2 > 3)
|
||||||
call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
||||||
jf(L7 [else branch]|<v8>) NEXT:[read (Unit), mark({ continue @l })]
|
jf(L8 [else branch]|<v8>) NEXT:[read (Unit), mark({ continue @l })]
|
||||||
6 mark({ continue @l })
|
6 mark({ continue @l })
|
||||||
jmp(L4 ['for' loop condition entry point]) NEXT:[jmp?(L3 ['for' loop exit point])]
|
jmp(L7 [condition entry point]) NEXT:[jmp?(L4 [loop exit point])]
|
||||||
- 5 jmp(L8 ['if' expression result]) NEXT:[merge(if (2 > 3) { continue @l }|!<v9>) -> <v10>] PREV:[]
|
- 5 jmp(L9 ['if' expression result]) NEXT:[merge(if (2 > 3) { continue @l }|!<v9>) -> <v10>] PREV:[]
|
||||||
L7 [else branch]:
|
L8 [else branch]:
|
||||||
read (Unit) PREV:[jf(L7 [else branch]|<v8>)]
|
read (Unit) PREV:[jf(L8 [else branch]|<v8>)]
|
||||||
L8 ['if' expression result]:
|
L9 ['if' expression result]:
|
||||||
merge(if (2 > 3) { continue @l }|!<v9>) -> <v10>
|
merge(if (2 > 3) { continue @l }|!<v9>) -> <v10>
|
||||||
4 jmp?(L5 [loop entry point]) NEXT:[magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>, read (Unit)]
|
4 jmp(L3 [loop entry point]) NEXT:[jmp?(L4 [loop exit point])]
|
||||||
L3 ['for' loop exit point]:
|
L4 [loop exit point]:
|
||||||
read (Unit) PREV:[jmp?(L3 ['for' loop exit point]), jmp?(L5 [loop entry point])]
|
L6 [body exit point]:
|
||||||
|
read (Unit) PREV:[jmp?(L4 [loop exit point])]
|
||||||
3 r(5) -> <v12>
|
3 r(5) -> <v12>
|
||||||
2 jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
2 jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
||||||
L2 [onExceptionToFinallyBlock]:
|
L2 [onExceptionToFinallyBlock]:
|
||||||
L10 [start finally]:
|
L11 [start finally]:
|
||||||
3 mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
|
3 mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
|
||||||
r(2) -> <v13>
|
r(2) -> <v13>
|
||||||
L11 [finish finally]:
|
L12 [finish finally]:
|
||||||
2 jmp(error) NEXT:[<ERROR>]
|
2 jmp(error) NEXT:[<ERROR>]
|
||||||
L9 [skipFinallyToErrorBlock]:
|
L10 [skipFinallyToErrorBlock]:
|
||||||
3 mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])]
|
3 mark({ 2 }) PREV:[jmp(L10 [skipFinallyToErrorBlock])]
|
||||||
r(2) -> <v13>
|
r(2) -> <v13>
|
||||||
2 merge(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 }|<v12>) -> <v14>
|
2 merge(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 }|<v12>) -> <v14>
|
||||||
L1:
|
L1:
|
||||||
@@ -611,13 +616,13 @@ L0:
|
|||||||
mark(1..a)
|
mark(1..a)
|
||||||
call(1..a, rangeTo|<v1>, <v2>) -> <v3>
|
call(1..a, rangeTo|<v1>, <v2>) -> <v3>
|
||||||
v(i)
|
v(i)
|
||||||
L4 ['for' loop condition entry point]:
|
L3 [loop entry point]:
|
||||||
jmp?(L3 ['for' loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>] PREV:[v(i), jmp(L4 ['for' loop condition entry point])]
|
L7 [condition entry point]:
|
||||||
L5 [loop entry point]:
|
jmp?(L4 [loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>] PREV:[v(i), jmp(L7 [condition entry point]), jmp(L3 [loop entry point])]
|
||||||
L6 [body entry point]:
|
magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>
|
||||||
magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4> PREV:[jmp?(L3 ['for' loop exit point]), jmp?(L5 [loop entry point])]
|
|
||||||
w(i|<v4>)
|
w(i|<v4>)
|
||||||
mark(for (i in 1..a) { 1 if (2 > 3) { continue @l } })
|
mark(for (i in 1..a) { 1 if (2 > 3) { continue @l } })
|
||||||
|
L5 [body entry point]:
|
||||||
5 mark({ 1 if (2 > 3) { continue @l } })
|
5 mark({ 1 if (2 > 3) { continue @l } })
|
||||||
r(1) -> <v5>
|
r(1) -> <v5>
|
||||||
mark(if (2 > 3) { continue @l })
|
mark(if (2 > 3) { continue @l })
|
||||||
@@ -625,26 +630,27 @@ L6 [body entry point]:
|
|||||||
r(3) -> <v7>
|
r(3) -> <v7>
|
||||||
mark(2 > 3)
|
mark(2 > 3)
|
||||||
call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
call(2 > 3, compareTo|<v6>, <v7>) -> <v8>
|
||||||
jf(L7 [else branch]|<v8>) NEXT:[read (Unit), mark({ continue @l })]
|
jf(L8 [else branch]|<v8>) NEXT:[read (Unit), mark({ continue @l })]
|
||||||
6 mark({ continue @l })
|
6 mark({ continue @l })
|
||||||
jmp(L4 ['for' loop condition entry point]) NEXT:[jmp?(L3 ['for' loop exit point])]
|
jmp(L7 [condition entry point]) NEXT:[jmp?(L4 [loop exit point])]
|
||||||
- 5 jmp(L8 ['if' expression result]) NEXT:[merge(if (2 > 3) { continue @l }|!<v9>) -> <v10>] PREV:[]
|
- 5 jmp(L9 ['if' expression result]) NEXT:[merge(if (2 > 3) { continue @l }|!<v9>) -> <v10>] PREV:[]
|
||||||
L7 [else branch]:
|
L8 [else branch]:
|
||||||
read (Unit) PREV:[jf(L7 [else branch]|<v8>)]
|
read (Unit) PREV:[jf(L8 [else branch]|<v8>)]
|
||||||
L8 ['if' expression result]:
|
L9 ['if' expression result]:
|
||||||
merge(if (2 > 3) { continue @l }|!<v9>) -> <v10>
|
merge(if (2 > 3) { continue @l }|!<v9>) -> <v10>
|
||||||
4 jmp?(L5 [loop entry point]) NEXT:[magic[LOOP_RANGE_ITERATION](1..a|<v3>) -> <v4>, read (Unit)]
|
4 jmp(L3 [loop entry point]) NEXT:[jmp?(L4 [loop exit point])]
|
||||||
L3 ['for' loop exit point]:
|
L4 [loop exit point]:
|
||||||
read (Unit) PREV:[jmp?(L3 ['for' loop exit point]), jmp?(L5 [loop entry point])]
|
L6 [body exit point]:
|
||||||
2 jmp(L9 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
read (Unit) PREV:[jmp?(L4 [loop exit point])]
|
||||||
|
2 jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ 2 })]
|
||||||
L2 [onExceptionToFinallyBlock]:
|
L2 [onExceptionToFinallyBlock]:
|
||||||
L10 [start finally]:
|
L11 [start finally]:
|
||||||
3 mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
|
3 mark({ 2 }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
|
||||||
r(2) -> <v12>
|
r(2) -> <v12>
|
||||||
L11 [finish finally]:
|
L12 [finish finally]:
|
||||||
2 jmp(error) NEXT:[<ERROR>]
|
2 jmp(error) NEXT:[<ERROR>]
|
||||||
L9 [skipFinallyToErrorBlock]:
|
L10 [skipFinallyToErrorBlock]:
|
||||||
3 mark({ 2 }) PREV:[jmp(L9 [skipFinallyToErrorBlock])]
|
3 mark({ 2 }) PREV:[jmp(L10 [skipFinallyToErrorBlock])]
|
||||||
r(2) -> <v12>
|
r(2) -> <v12>
|
||||||
2 merge(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } } finally { 2 }|!<v11>) -> <v13>
|
2 merge(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } } finally { 2 }|!<v11>) -> <v13>
|
||||||
L1:
|
L1:
|
||||||
@@ -973,4 +979,4 @@ error:
|
|||||||
<ERROR> PREV:[]
|
<ERROR> PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> PREV:[<ERROR>, <END>]
|
<SINK> PREV:[<ERROR>, <END>]
|
||||||
=====================
|
=====================
|
||||||
|
|||||||
@@ -141,67 +141,68 @@ L0:
|
|||||||
1 <START>
|
1 <START>
|
||||||
2 mark({ while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } })
|
2 mark({ while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } })
|
||||||
L2 [loop entry point]:
|
L2 [loop entry point]:
|
||||||
L5 [condition entry point]:
|
L6 [condition entry point]:
|
||||||
mark(cond()) PREV:[mark({ while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } }), jmp(L5 [condition entry point]), jmp(L5 [condition entry point])]
|
mark(cond()) PREV:[mark({ while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } }), jmp(L6 [condition entry point]), jmp(L6 [condition entry point])]
|
||||||
call(cond(), cond) -> <v0>
|
call(cond(), cond) -> <v0>
|
||||||
mark(while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })
|
mark(while (cond()) { try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })
|
||||||
jf(L3 [loop exit point]|<v0>) NEXT:[read (Unit), mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })]
|
jf(L3 [loop exit point]|<v0>) NEXT:[read (Unit), mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })]
|
||||||
L4 [body entry point]:
|
L4 [body entry point]:
|
||||||
3 mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })
|
3 mark({ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } })
|
||||||
mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue })
|
mark(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue })
|
||||||
jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])]
|
jmp?(L7 [onException]) NEXT:[jmp?(L10 [catch 0]), jmp?(L8 [onExceptionToFinallyBlock])]
|
||||||
jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[mark({ if (cond()) return else continue }), mark({ doSmth() })]
|
jmp?(L8 [onExceptionToFinallyBlock]) NEXT:[mark({ if (cond()) return else continue }), mark({ doSmth() })]
|
||||||
4 mark({ doSmth() })
|
4 mark({ doSmth() })
|
||||||
mark(doSmth())
|
mark(doSmth())
|
||||||
call(doSmth(), doSmth) -> <v1>
|
call(doSmth(), doSmth) -> <v1>
|
||||||
3 jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])]
|
3 jmp(L9 [afterCatches]) NEXT:[jmp(L11 [skipFinallyToErrorBlock])]
|
||||||
L6 [onException]:
|
L7 [onException]:
|
||||||
jmp?(L9 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L6 [onException])]
|
jmp?(L10 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L7 [onException])]
|
||||||
4 v(e: NullPointerException)
|
4 v(e: NullPointerException)
|
||||||
magic[FAKE_INITIALIZER](e: NullPointerException) -> <v2>
|
magic[FAKE_INITIALIZER](e: NullPointerException) -> <v2>
|
||||||
w(e|<v2>)
|
w(e|<v2>)
|
||||||
5 mark({ doSmth1() })
|
5 mark({ doSmth1() })
|
||||||
mark(doSmth1())
|
mark(doSmth1())
|
||||||
call(doSmth1(), doSmth1) -> <v3>
|
call(doSmth1(), doSmth1) -> <v3>
|
||||||
4 jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])]
|
4 jmp(L9 [afterCatches]) NEXT:[jmp(L11 [skipFinallyToErrorBlock])]
|
||||||
L9 [catch 0]:
|
L10 [catch 0]:
|
||||||
v(e: Exception) PREV:[jmp?(L9 [catch 0])]
|
v(e: Exception) PREV:[jmp?(L10 [catch 0])]
|
||||||
magic[FAKE_INITIALIZER](e: Exception) -> <v4>
|
magic[FAKE_INITIALIZER](e: Exception) -> <v4>
|
||||||
w(e|<v4>)
|
w(e|<v4>)
|
||||||
5 mark({ doSmth2() })
|
5 mark({ doSmth2() })
|
||||||
mark(doSmth2())
|
mark(doSmth2())
|
||||||
call(doSmth2(), doSmth2) -> <v5>
|
call(doSmth2(), doSmth2) -> <v5>
|
||||||
4 jmp(L8 [afterCatches])
|
4 jmp(L9 [afterCatches])
|
||||||
L8 [afterCatches]:
|
L9 [afterCatches]:
|
||||||
3 jmp(L10 [skipFinallyToErrorBlock]) NEXT:[mark({ if (cond()) return else continue })] PREV:[jmp(L8 [afterCatches]), jmp(L8 [afterCatches]), jmp(L8 [afterCatches])]
|
3 jmp(L11 [skipFinallyToErrorBlock]) NEXT:[mark({ if (cond()) return else continue })] PREV:[jmp(L9 [afterCatches]), jmp(L9 [afterCatches]), jmp(L9 [afterCatches])]
|
||||||
L7 [onExceptionToFinallyBlock]:
|
L8 [onExceptionToFinallyBlock]:
|
||||||
L11 [start finally]:
|
L12 [start finally]:
|
||||||
4 mark({ if (cond()) return else continue }) PREV:[jmp?(L7 [onExceptionToFinallyBlock])]
|
4 mark({ if (cond()) return else continue }) PREV:[jmp?(L8 [onExceptionToFinallyBlock])]
|
||||||
mark(if (cond()) return else continue)
|
mark(if (cond()) return else continue)
|
||||||
mark(cond())
|
mark(cond())
|
||||||
call(cond(), cond) -> <v6>
|
call(cond(), cond) -> <v6>
|
||||||
jf(L12 [else branch]|<v6>) NEXT:[jmp(L5 [condition entry point]), ret L1]
|
jf(L13 [else branch]|<v6>) NEXT:[jmp(L6 [condition entry point]), ret L1]
|
||||||
ret L1 NEXT:[<END>]
|
ret L1 NEXT:[<END>]
|
||||||
- jmp(L13 ['if' expression result]) NEXT:[merge(if (cond()) return else continue|!<v7>, !<v8>) -> <v9>] PREV:[]
|
- jmp(L14 ['if' expression result]) NEXT:[merge(if (cond()) return else continue|!<v7>, !<v8>) -> <v9>] PREV:[]
|
||||||
L12 [else branch]:
|
L13 [else branch]:
|
||||||
jmp(L5 [condition entry point]) NEXT:[mark(cond())] PREV:[jf(L12 [else branch]|<v6>)]
|
jmp(L6 [condition entry point]) NEXT:[mark(cond())] PREV:[jf(L13 [else branch]|<v6>)]
|
||||||
L13 ['if' expression result]:
|
L14 ['if' expression result]:
|
||||||
- merge(if (cond()) return else continue|!<v7>, !<v8>) -> <v9> PREV:[]
|
- merge(if (cond()) return else continue|!<v7>, !<v8>) -> <v9> PREV:[]
|
||||||
L14 [finish finally]:
|
L15 [finish finally]:
|
||||||
- 3 jmp(error) NEXT:[<ERROR>] PREV:[]
|
- 3 jmp(error) NEXT:[<ERROR>] PREV:[]
|
||||||
L10 [skipFinallyToErrorBlock]:
|
L11 [skipFinallyToErrorBlock]:
|
||||||
4 mark({ if (cond()) return else continue }) PREV:[jmp(L10 [skipFinallyToErrorBlock])]
|
4 mark({ if (cond()) return else continue }) PREV:[jmp(L11 [skipFinallyToErrorBlock])]
|
||||||
mark(if (cond()) return else continue)
|
mark(if (cond()) return else continue)
|
||||||
mark(cond())
|
mark(cond())
|
||||||
call(cond(), cond) -> <v6>
|
call(cond(), cond) -> <v6>
|
||||||
jf(copy L12 [else branch]|<v6>) NEXT:[jmp(L5 [condition entry point]), ret L1]
|
jf(copy L13 [else branch]|<v6>) NEXT:[jmp(L6 [condition entry point]), ret L1]
|
||||||
ret L1 NEXT:[<END>]
|
ret L1 NEXT:[<END>]
|
||||||
- jmp(copy L13 ['if' expression result]) NEXT:[merge(if (cond()) return else continue|!<v7>, !<v8>) -> <v9>] PREV:[]
|
- jmp(copy L14 ['if' expression result]) NEXT:[merge(if (cond()) return else continue|!<v7>, !<v8>) -> <v9>] PREV:[]
|
||||||
jmp(L5 [condition entry point]) NEXT:[mark(cond())] PREV:[jf(copy L12 [else branch]|<v6>)]
|
jmp(L6 [condition entry point]) NEXT:[mark(cond())] PREV:[jf(copy L13 [else branch]|<v6>)]
|
||||||
- merge(if (cond()) return else continue|!<v7>, !<v8>) -> <v9> PREV:[]
|
- merge(if (cond()) return else continue|!<v7>, !<v8>) -> <v9> PREV:[]
|
||||||
- 3 merge(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue }|<v1>, <v3>, <v5>) -> <v10> PREV:[]
|
- 3 merge(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue }|<v1>, <v3>, <v5>) -> <v10> PREV:[]
|
||||||
- 2 jmp(L2 [loop entry point]) NEXT:[mark(cond())] PREV:[]
|
- 2 jmp(L2 [loop entry point]) NEXT:[mark(cond())] PREV:[]
|
||||||
L3 [loop exit point]:
|
L3 [loop exit point]:
|
||||||
|
L5 [body exit point]:
|
||||||
read (Unit) PREV:[jf(L3 [loop exit point]|<v0>)]
|
read (Unit) PREV:[jf(L3 [loop exit point]|<v0>)]
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>] PREV:[ret L1, ret L1, read (Unit)]
|
1 <END> NEXT:[<SINK>] PREV:[ret L1, ret L1, read (Unit)]
|
||||||
@@ -259,7 +260,7 @@ L3 [onExceptionToFinallyBlock]:
|
|||||||
L7 [start finally]:
|
L7 [start finally]:
|
||||||
3 mark({ while (cond()); }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
|
3 mark({ while (cond()); }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
|
||||||
L8 [loop entry point]:
|
L8 [loop entry point]:
|
||||||
L11 [condition entry point]:
|
L12 [condition entry point]:
|
||||||
mark(cond()) PREV:[mark({ while (cond()); }), jmp(L8 [loop entry point])]
|
mark(cond()) PREV:[mark({ while (cond()); }), jmp(L8 [loop entry point])]
|
||||||
call(cond(), cond) -> <v5>
|
call(cond(), cond) -> <v5>
|
||||||
mark(while (cond()))
|
mark(while (cond()))
|
||||||
@@ -267,8 +268,9 @@ L11 [condition entry point]:
|
|||||||
L10 [body entry point]:
|
L10 [body entry point]:
|
||||||
jmp(L8 [loop entry point]) NEXT:[mark(cond())]
|
jmp(L8 [loop entry point]) NEXT:[mark(cond())]
|
||||||
L9 [loop exit point]:
|
L9 [loop exit point]:
|
||||||
|
L11 [body exit point]:
|
||||||
read (Unit) PREV:[jf(L9 [loop exit point]|<v5>)]
|
read (Unit) PREV:[jf(L9 [loop exit point]|<v5>)]
|
||||||
L12 [finish finally]:
|
L13 [finish finally]:
|
||||||
2 jmp(error) NEXT:[<ERROR>]
|
2 jmp(error) NEXT:[<ERROR>]
|
||||||
L6 [skipFinallyToErrorBlock]:
|
L6 [skipFinallyToErrorBlock]:
|
||||||
3 mark({ while (cond()); }) PREV:[jmp(L6 [skipFinallyToErrorBlock])]
|
3 mark({ while (cond()); }) PREV:[jmp(L6 [skipFinallyToErrorBlock])]
|
||||||
|
|||||||
@@ -13,20 +13,21 @@ L0:
|
|||||||
mark(1..2)
|
mark(1..2)
|
||||||
call(1..2, rangeTo|<v0>, <v1>) -> <v2>
|
call(1..2, rangeTo|<v0>, <v1>) -> <v2>
|
||||||
v(i)
|
v(i)
|
||||||
L3 ['for' loop condition entry point]:
|
L2 [loop entry point]:
|
||||||
jmp?(L2 ['for' loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..2|<v2>) -> <v3>]
|
L6 [condition entry point]:
|
||||||
L4 [loop entry point]:
|
jmp?(L3 [loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..2|<v2>) -> <v3>] PREV:[v(i), jmp(L2 [loop entry point])]
|
||||||
L5 [body entry point]:
|
magic[LOOP_RANGE_ITERATION](1..2|<v2>) -> <v3>
|
||||||
magic[LOOP_RANGE_ITERATION](1..2|<v2>) -> <v3> PREV:[jmp?(L2 ['for' loop exit point]), jmp?(L4 [loop entry point])]
|
|
||||||
w(i|<v3>)
|
w(i|<v3>)
|
||||||
mark(for (i in 1..2) { doSmth(i) })
|
mark(for (i in 1..2) { doSmth(i) })
|
||||||
|
L4 [body entry point]:
|
||||||
4 mark({ doSmth(i) })
|
4 mark({ doSmth(i) })
|
||||||
r(i) -> <v4>
|
r(i) -> <v4>
|
||||||
mark(doSmth(i))
|
mark(doSmth(i))
|
||||||
call(doSmth(i), doSmth|<v4>) -> <v5>
|
call(doSmth(i), doSmth|<v4>) -> <v5>
|
||||||
3 jmp?(L4 [loop entry point]) NEXT:[magic[LOOP_RANGE_ITERATION](1..2|<v2>) -> <v3>, read (Unit)]
|
3 jmp(L2 [loop entry point]) NEXT:[jmp?(L3 [loop exit point])]
|
||||||
L2 ['for' loop exit point]:
|
L3 [loop exit point]:
|
||||||
read (Unit) PREV:[jmp?(L2 ['for' loop exit point]), jmp?(L4 [loop entry point])]
|
L5 [body exit point]:
|
||||||
|
read (Unit) PREV:[jmp?(L3 [loop exit point])]
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>]
|
1 <END> NEXT:[<SINK>]
|
||||||
error:
|
error:
|
||||||
@@ -50,4 +51,4 @@ error:
|
|||||||
<ERROR> PREV:[]
|
<ERROR> PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> PREV:[<ERROR>, <END>]
|
<SINK> PREV:[<ERROR>, <END>]
|
||||||
=====================
|
=====================
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ L0:
|
|||||||
1 <START>
|
1 <START>
|
||||||
2 mark({ while(0 > 1) { 2 } })
|
2 mark({ while(0 > 1) { 2 } })
|
||||||
L2 [loop entry point]:
|
L2 [loop entry point]:
|
||||||
L5 [condition entry point]:
|
L6 [condition entry point]:
|
||||||
r(0) -> <v0> PREV:[mark({ while(0 > 1) { 2 } }), jmp(L2 [loop entry point])]
|
r(0) -> <v0> PREV:[mark({ while(0 > 1) { 2 } }), jmp(L2 [loop entry point])]
|
||||||
r(1) -> <v1>
|
r(1) -> <v1>
|
||||||
mark(0 > 1)
|
mark(0 > 1)
|
||||||
@@ -21,6 +21,7 @@ L4 [body entry point]:
|
|||||||
r(2) -> <v3>
|
r(2) -> <v3>
|
||||||
2 jmp(L2 [loop entry point]) NEXT:[r(0) -> <v0>]
|
2 jmp(L2 [loop entry point]) NEXT:[r(0) -> <v0>]
|
||||||
L3 [loop exit point]:
|
L3 [loop exit point]:
|
||||||
|
L5 [body exit point]:
|
||||||
read (Unit) PREV:[jf(L3 [loop exit point]|<v2>)]
|
read (Unit) PREV:[jf(L3 [loop exit point]|<v2>)]
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>]
|
1 <END> NEXT:[<SINK>]
|
||||||
@@ -43,7 +44,8 @@ L2 [loop entry point]:
|
|||||||
L4 [body entry point]:
|
L4 [body entry point]:
|
||||||
mark({return})
|
mark({return})
|
||||||
ret L1 NEXT:[<END>]
|
ret L1 NEXT:[<END>]
|
||||||
L5 [condition entry point]:
|
L5 [body exit point]:
|
||||||
|
L6 [condition entry point]:
|
||||||
- r(0) -> <v1> PREV:[]
|
- r(0) -> <v1> PREV:[]
|
||||||
- r(1) -> <v2> PREV:[]
|
- r(1) -> <v2> PREV:[]
|
||||||
- mark(0 > 1) PREV:[]
|
- mark(0 > 1) PREV:[]
|
||||||
|
|||||||
@@ -18,15 +18,16 @@ L4 [body entry point]:
|
|||||||
mark({ if (b) break; continue; }) PREV:[mark(do { if (b) break; continue; } while (true)), jt(L2 [loop entry point]|<v5>)]
|
mark({ if (b) break; continue; }) PREV:[mark(do { if (b) break; continue; } while (true)), jt(L2 [loop entry point]|<v5>)]
|
||||||
mark(if (b) break)
|
mark(if (b) break)
|
||||||
r(b) -> <v1>
|
r(b) -> <v1>
|
||||||
jf(L6 [else branch]|<v1>) NEXT:[read (Unit), jmp(L3 [loop exit point])]
|
jf(L7 [else branch]|<v1>) NEXT:[read (Unit), jmp(L3 [loop exit point])]
|
||||||
jmp(L3 [loop exit point]) NEXT:[read (Unit)]
|
jmp(L3 [loop exit point]) NEXT:[read (Unit)]
|
||||||
- jmp(L7 ['if' expression result]) NEXT:[merge(if (b) break|!<v2>) -> <v3>] PREV:[]
|
- jmp(L8 ['if' expression result]) NEXT:[merge(if (b) break|!<v2>) -> <v3>] PREV:[]
|
||||||
L6 [else branch]:
|
L7 [else branch]:
|
||||||
read (Unit) PREV:[jf(L6 [else branch]|<v1>)]
|
read (Unit) PREV:[jf(L7 [else branch]|<v1>)]
|
||||||
L7 ['if' expression result]:
|
L8 ['if' expression result]:
|
||||||
merge(if (b) break|!<v2>) -> <v3>
|
merge(if (b) break|!<v2>) -> <v3>
|
||||||
jmp(L5 [condition entry point])
|
jmp(L6 [condition entry point])
|
||||||
L5 [condition entry point]:
|
L5 [body exit point]:
|
||||||
|
L6 [condition entry point]:
|
||||||
r(true) -> <v5>
|
r(true) -> <v5>
|
||||||
jt(L2 [loop entry point]|<v5>) NEXT:[read (Unit), mark({ if (b) break; continue; })]
|
jt(L2 [loop entry point]|<v5>) NEXT:[read (Unit), mark({ if (b) break; continue; })]
|
||||||
L3 [loop exit point]:
|
L3 [loop exit point]:
|
||||||
|
|||||||
@@ -17,31 +17,32 @@ L0:
|
|||||||
mark(1..10)
|
mark(1..10)
|
||||||
call(1..10, rangeTo|<v1>, <v2>) -> <v3>
|
call(1..10, rangeTo|<v1>, <v2>) -> <v3>
|
||||||
v(i)
|
v(i)
|
||||||
L3 ['for' loop condition entry point]:
|
L2 [loop entry point]:
|
||||||
jmp?(L2 ['for' loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..10|<v3>) -> <v4>] PREV:[v(i), jmp(L3 ['for' loop condition entry point])]
|
L6 [condition entry point]:
|
||||||
L4 [loop entry point]:
|
jmp?(L3 [loop exit point]) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..10|<v3>) -> <v4>] PREV:[v(i), jmp(L6 [condition entry point])]
|
||||||
L5 [body entry point]:
|
|
||||||
magic[LOOP_RANGE_ITERATION](1..10|<v3>) -> <v4>
|
magic[LOOP_RANGE_ITERATION](1..10|<v3>) -> <v4>
|
||||||
w(i|<v4>)
|
w(i|<v4>)
|
||||||
mark(for (i in 1..10) { if (b) break; continue; })
|
mark(for (i in 1..10) { if (b) break; continue; })
|
||||||
|
L4 [body entry point]:
|
||||||
4 mark({ if (b) break; continue; })
|
4 mark({ if (b) break; continue; })
|
||||||
mark(if (b) break)
|
mark(if (b) break)
|
||||||
r(b) -> <v5>
|
r(b) -> <v5>
|
||||||
jf(L6 [else branch]|<v5>) NEXT:[read (Unit), jmp(L2 ['for' loop exit point])]
|
jf(L7 [else branch]|<v5>) NEXT:[read (Unit), jmp(L3 [loop exit point])]
|
||||||
jmp(L2 ['for' loop exit point]) NEXT:[read (Unit)]
|
jmp(L3 [loop exit point]) NEXT:[read (Unit)]
|
||||||
- jmp(L7 ['if' expression result]) NEXT:[merge(if (b) break|!<v6>) -> <v7>] PREV:[]
|
- jmp(L8 ['if' expression result]) NEXT:[merge(if (b) break|!<v6>) -> <v7>] PREV:[]
|
||||||
L6 [else branch]:
|
L7 [else branch]:
|
||||||
read (Unit) PREV:[jf(L6 [else branch]|<v5>)]
|
read (Unit) PREV:[jf(L7 [else branch]|<v5>)]
|
||||||
L7 ['if' expression result]:
|
L8 ['if' expression result]:
|
||||||
merge(if (b) break|!<v6>) -> <v7>
|
merge(if (b) break|!<v6>) -> <v7>
|
||||||
jmp(L3 ['for' loop condition entry point]) NEXT:[jmp?(L2 ['for' loop exit point])]
|
jmp(L6 [condition entry point]) NEXT:[jmp?(L3 [loop exit point])]
|
||||||
- 3 jmp?(L4 [loop entry point]) NEXT:[magic[LOOP_RANGE_ITERATION](1..10|<v3>) -> <v4>, read (Unit)] PREV:[]
|
- 3 jmp(L2 [loop entry point]) NEXT:[jmp?(L3 [loop exit point])] PREV:[]
|
||||||
L2 ['for' loop exit point]:
|
L3 [loop exit point]:
|
||||||
read (Unit) PREV:[jmp?(L2 ['for' loop exit point]), jmp(L2 ['for' loop exit point])]
|
L5 [body exit point]:
|
||||||
|
read (Unit) PREV:[jmp?(L3 [loop exit point]), jmp(L3 [loop exit point])]
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>]
|
1 <END> NEXT:[<SINK>]
|
||||||
error:
|
error:
|
||||||
<ERROR> PREV:[]
|
<ERROR> PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> PREV:[<ERROR>, <END>]
|
<SINK> PREV:[<ERROR>, <END>]
|
||||||
=====================
|
=====================
|
||||||
|
|||||||
@@ -13,24 +13,25 @@ L0:
|
|||||||
w(b|<v0>)
|
w(b|<v0>)
|
||||||
2 mark({ while (true) { if (b) break; continue; } })
|
2 mark({ while (true) { if (b) break; continue; } })
|
||||||
L2 [loop entry point]:
|
L2 [loop entry point]:
|
||||||
L5 [condition entry point]:
|
L6 [condition entry point]:
|
||||||
r(true) -> <v1> PREV:[mark({ while (true) { if (b) break; continue; } }), jmp(L5 [condition entry point])]
|
r(true) -> <v1> PREV:[mark({ while (true) { if (b) break; continue; } }), jmp(L6 [condition entry point])]
|
||||||
mark(while (true) { if (b) break; continue; })
|
mark(while (true) { if (b) break; continue; })
|
||||||
magic[VALUE_CONSUMER](true|<v1>) -> <v2>
|
magic[VALUE_CONSUMER](true|<v1>) -> <v2>
|
||||||
L4 [body entry point]:
|
L4 [body entry point]:
|
||||||
3 mark({ if (b) break; continue; })
|
3 mark({ if (b) break; continue; })
|
||||||
mark(if (b) break)
|
mark(if (b) break)
|
||||||
r(b) -> <v3>
|
r(b) -> <v3>
|
||||||
jf(L6 [else branch]|<v3>) NEXT:[read (Unit), jmp(L3 [loop exit point])]
|
jf(L7 [else branch]|<v3>) NEXT:[read (Unit), jmp(L3 [loop exit point])]
|
||||||
jmp(L3 [loop exit point]) NEXT:[read (Unit)]
|
jmp(L3 [loop exit point]) NEXT:[read (Unit)]
|
||||||
- jmp(L7 ['if' expression result]) NEXT:[merge(if (b) break|!<v4>) -> <v5>] PREV:[]
|
- jmp(L8 ['if' expression result]) NEXT:[merge(if (b) break|!<v4>) -> <v5>] PREV:[]
|
||||||
L6 [else branch]:
|
L7 [else branch]:
|
||||||
read (Unit) PREV:[jf(L6 [else branch]|<v3>)]
|
read (Unit) PREV:[jf(L7 [else branch]|<v3>)]
|
||||||
L7 ['if' expression result]:
|
L8 ['if' expression result]:
|
||||||
merge(if (b) break|!<v4>) -> <v5>
|
merge(if (b) break|!<v4>) -> <v5>
|
||||||
jmp(L5 [condition entry point]) NEXT:[r(true) -> <v1>]
|
jmp(L6 [condition entry point]) NEXT:[r(true) -> <v1>]
|
||||||
- 2 jmp(L2 [loop entry point]) NEXT:[r(true) -> <v1>] PREV:[]
|
- 2 jmp(L2 [loop entry point]) NEXT:[r(true) -> <v1>] PREV:[]
|
||||||
L3 [loop exit point]:
|
L3 [loop exit point]:
|
||||||
|
L5 [body exit point]:
|
||||||
read (Unit) PREV:[jmp(L3 [loop exit point])]
|
read (Unit) PREV:[jmp(L3 [loop exit point])]
|
||||||
L1:
|
L1:
|
||||||
1 <END> NEXT:[<SINK>]
|
1 <END> NEXT:[<SINK>]
|
||||||
@@ -38,4 +39,4 @@ error:
|
|||||||
<ERROR> PREV:[]
|
<ERROR> PREV:[]
|
||||||
sink:
|
sink:
|
||||||
<SINK> PREV:[<ERROR>, <END>]
|
<SINK> PREV:[<ERROR>, <END>]
|
||||||
=====================
|
=====================
|
||||||
|
|||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
fun test() {
|
||||||
|
|
||||||
|
@l for (i in if (true) 1..10 else <!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>continue@l<!>) {}
|
||||||
|
for (i in if (true) 1..10 else <!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>continue<!>) {}
|
||||||
|
|
||||||
|
while (<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>break<!>) {}
|
||||||
|
@l while (<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>break@l<!>) {}
|
||||||
|
|
||||||
|
do {} while (<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>continue<!>)
|
||||||
|
@l do {} while (<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>continue@l<!>)
|
||||||
|
|
||||||
|
//KT-5704
|
||||||
|
var i = 0
|
||||||
|
while (if(i++ == 10) <!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>break<!> else <!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>continue<!>) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test2(b: Boolean) {
|
||||||
|
while (b) {
|
||||||
|
<!UNREACHABLE_CODE!>while (<!>break<!UNREACHABLE_CODE!>) {}<!>
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
<!UNREACHABLE_CODE!>while (<!>continue<!UNREACHABLE_CODE!>) {}<!>
|
||||||
|
} while (b)
|
||||||
|
|
||||||
|
while (b) {
|
||||||
|
do {} while (break)
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i in 1..10) {
|
||||||
|
for (j in if (true) 1..10 else continue) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1202,6 +1202,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/backingFieldInsideGetter.kt");
|
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/backingFieldInsideGetter.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("breakOrContinueInLoopCondition.kt")
|
||||||
|
public void testBreakOrContinueInLoopCondition() throws Exception {
|
||||||
|
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/breakOrContinueInLoopCondition.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("checkInnerLocalDeclarations.kt")
|
@TestMetadata("checkInnerLocalDeclarations.kt")
|
||||||
public void testCheckInnerLocalDeclarations() throws Exception {
|
public void testCheckInnerLocalDeclarations() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/checkInnerLocalDeclarations.kt");
|
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/checkInnerLocalDeclarations.kt");
|
||||||
|
|||||||
-11
@@ -56,17 +56,6 @@ fun forReturn(b: Boolean): String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
var i = 0
|
|
||||||
|
|
||||||
// KT-5704 'while' detected as unreachable though loop is running
|
|
||||||
// TODO Remove or uncomment when issue will be fixed
|
|
||||||
//while(if (++i==10) break else continue) {}
|
|
||||||
//assertEquals(10, i)
|
|
||||||
|
|
||||||
i = 0
|
|
||||||
do { i++ } while(if (++i==10) break else continue)
|
|
||||||
assertEquals(10, i)
|
|
||||||
|
|
||||||
assertEquals(":whileReturn:", whileReturn())
|
assertEquals(":whileReturn:", whileReturn())
|
||||||
assertEquals("AA:return:", global)
|
assertEquals("AA:return:", global)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user