diff --git a/core/src/main/java/org/teavm/common/GraphUtils.java b/core/src/main/java/org/teavm/common/GraphUtils.java index 744583f3b..f46de92d6 100644 --- a/core/src/main/java/org/teavm/common/GraphUtils.java +++ b/core/src/main/java/org/teavm/common/GraphUtils.java @@ -343,7 +343,7 @@ public final class GraphUtils { stack[top++] = node; for (int successor : graph.outgoingEdges(node)) { if (state[successor] == 0) { - stack[top++] = node; + stack[top++] = successor; } } break; diff --git a/core/src/main/java/org/teavm/model/analysis/AliasAnalysis.java b/core/src/main/java/org/teavm/model/analysis/AliasAnalysis.java index c281b871c..a29e08740 100644 --- a/core/src/main/java/org/teavm/model/analysis/AliasAnalysis.java +++ b/core/src/main/java/org/teavm/model/analysis/AliasAnalysis.java @@ -65,6 +65,9 @@ public class AliasAnalysis { private DfgBuildVisitor prepare(Program program, MethodDescriptor methodDescriptor) { DfgBuildVisitor visitor = new DfgBuildVisitor(program.variableCount()); + visitor.queue.addLast(0); + visitor.queue.addLast(0); + for (int i = 1; i <= methodDescriptor.parameterCount(); ++i) { if (methodDescriptor.parameterType(i - 1) instanceof ValueType.Object) { visitor.queue.addLast(i); diff --git a/core/src/main/java/org/teavm/model/optimization/Inlining.java b/core/src/main/java/org/teavm/model/optimization/Inlining.java index 716a81deb..c360aad73 100644 --- a/core/src/main/java/org/teavm/model/optimization/Inlining.java +++ b/core/src/main/java/org/teavm/model/optimization/Inlining.java @@ -502,7 +502,7 @@ public class Inlining { @Override public ProgramReader getProgram(MethodReference method) { - ClassReader cls = dependencyInfo.getClassSource().get(method.getClassName()); + ClassReader cls = classes.get(method.getClassName()); if (cls == null) { return null; }