Java: Fixed IOOBE in processing of sub-range of a control flow (IDEA-164442)

This commit is contained in:
Pavel Dolgov
2016-11-30 14:59:19 +03:00
parent 303f61d093
commit 323b3eef00
@@ -1462,7 +1462,8 @@ public class ControlFlowUtil {
// 'procedure' pointed by call instruction should be processed regardless of whether it was already visited or not
// clear procedure text and return instructions aftewards
int i;
for (i = instruction.procBegin; i < instruction.procEnd || instructions.get(i) instanceof ReturnInstruction; i++) {
for (i = instruction.procBegin;
i < instruction.procEnd || i < instructions.size() && instructions.get(i) instanceof ReturnInstruction; i++) {
clientVisitor.processedInstructions[i] = false;
}
clientVisitor.procedureEntered(instruction.procBegin, i);