List<BasicBlock> (BasicBlock start, ExceptionRangeCFG range, GenericDominatorEngine engine) { List<BasicBlock> lstRes = new ArrayList<>(); LinkedList<BasicBlock> stack = new LinkedList<>(); Set<BasicBlock> setVisited = new HashSet<>(); stack.addFirst(start); while (!stack.isEmpty()) { BasicBlock block = stack.removeFirst(); setVisited.add(block); if (range.getProtectedRange().contains(block) && engine.isDominator(block, start)) { lstRes.add(block); List<BasicBlock> lstSuccs = new ArrayList<>(block.getSuccessors()); lstSuccs.addAll(block.getSuccessorExceptions()); for (BasicBlock succ : lstSuccs) { if (!setVisited.contains(succ)) { stack.add(succ); } } } } return lstRes; }