From 288e3b97fea03459aa5a5eedb762d088cee6be1a Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Mon, 29 May 2017 23:23:47 +0300 Subject: [PATCH] Fix recognition of loop tree in a CFG (cherry picked from commit 8f58b924628b87d13cfb8352d032a4932dcba17f) --- core/src/main/java/org/teavm/common/LoopGraph.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/teavm/common/LoopGraph.java b/core/src/main/java/org/teavm/common/LoopGraph.java index 6ba7c2f9e..cf273f376 100644 --- a/core/src/main/java/org/teavm/common/LoopGraph.java +++ b/core/src/main/java/org/teavm/common/LoopGraph.java @@ -175,7 +175,7 @@ public class LoopGraph implements Graph { if (loop == testLoop) { return bestLoop; } - if (loop.walkIndex < testLoop.walkIndex) { + if (loop.parent.walkIndex < testLoop.walkIndex) { testLoop.parent = loop.parent; loop.parent = testLoop; break;