From 793d1e19d20623dd66e32f9fda92df542e59a1ad Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 13 Mar 2015 14:57:59 +0400 Subject: [PATCH] Fix another bug in DFG simplifier --- .../java/org/teavm/dependency/DataFlowGraphBuilder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/teavm-core/src/main/java/org/teavm/dependency/DataFlowGraphBuilder.java b/teavm-core/src/main/java/org/teavm/dependency/DataFlowGraphBuilder.java index d71cec93d..7fb34216b 100644 --- a/teavm-core/src/main/java/org/teavm/dependency/DataFlowGraphBuilder.java +++ b/teavm-core/src/main/java/org/teavm/dependency/DataFlowGraphBuilder.java @@ -66,11 +66,13 @@ public class DataFlowGraphBuilder implements InstructionReader { startNodes.add(i); } for (int pred : graph.incomingEdges(i)) { - if (importantNodes.contains(classes.find(pred)) && importantNodes.contains(classes.find(i))) { + boolean predImportant = importantNodes.contains(classes.find(pred)); + boolean nodeImportant = importantNodes.contains(classes.find(i)); + if (predImportant && nodeImportant) { continue; } int newCls = classes.union(pred, i); - if (importantNodes.contains(pred)) { + if (nodeImportant || predImportant) { importantNodes.add(newCls); } }