Fix infinite loop in inlining

This commit is contained in:
Alexey Andreev 2017-01-14 02:00:19 +03:00
parent 98b6fff2f0
commit 149970f162

View File

@ -98,7 +98,7 @@ public class Inlining {
program.createBasicBlock();
}
while (depthsByBlock.size() < program.basicBlockCount()) {
depthsByBlock.add(planEntry.depth);
depthsByBlock.add(planEntry.depth + 1);
}
int variableOffset = program.variableCount();
@ -225,6 +225,9 @@ public class Inlining {
if (originalDepth == 0) {
depth = depthsByBlock.get(block.getIndex());
if (depth >= MAX_DEPTH) {
continue;
}
}
for (Instruction insn : block) {