From c53a563e9637ee2b8f9db3f3aa908494269ea969 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Thu, 23 Jan 2020 15:53:11 +0300 Subject: [PATCH] Fix bug in devirtualization while inlining --- .../main/java/org/teavm/model/analysis/ClassInference.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/teavm/model/analysis/ClassInference.java b/core/src/main/java/org/teavm/model/analysis/ClassInference.java index dc7050af2..14143937e 100644 --- a/core/src/main/java/org/teavm/model/analysis/ClassInference.java +++ b/core/src/main/java/org/teavm/model/analysis/ClassInference.java @@ -260,7 +260,11 @@ public class ClassInference { if (degree > 0) { for (int predecessor : assignmentGraph.incomingEdges(variable)) { - nextEntries.add(packNodeAndDegree(predecessor, degree)); + int predecessorEntry = packNodeAndDegree(predecessor, degree); + graphBuilder.addEdge(predecessorEntry, entry); + if (!visited[predecessorEntry]) { + stack.push(predecessorEntry); + } } for (int successor : itemGraph.outgoingEdges(variable)) {