Fix bug in irreducible graph splitting algorithm

This commit is contained in:
Alexey Andreev 2021-07-15 19:17:11 +03:00
parent 220537d984
commit c65a9e1c97

View File

@ -105,7 +105,7 @@ class IrreducibleGraphSplitter {
this.domNodes = domGraph;
}
// n-th element of output array (levels) will contain length of the path from root to node node N
// n-th element of output array (levels) will contain length of the path from root to node N
// (paper calls this 'level').
private void buildLevels() {
int size = cfg.size();
@ -113,7 +113,7 @@ class IrreducibleGraphSplitter {
Arrays.fill(levels, -1);
levels[0] = 0;
for (int i = 1; i < size; ++i) {
if (levels[i] >= 0) {
if (levels[i] >= 0 || idom[i] < 0) {
continue;
}