Program: 27930
Project: 27930
Buggy source:
/** 
 * Attempts to minimize the number of explicit exit points in a control structure to take advantage of the implied exit at the end of the structure.  This is accomplished by removing redundant statements, and moving statements following a qualifying IF node into that node. For example: function () { if (x) return; else blah(); foo(); } becomes: function () { if (x) ; else { blah(); foo(); }
 * @param n The execution node of a parent to inspect.
 * @param exitType The type of exit to look for.
 * @param labelName If parent is a label the name of the label to look for,null otherwise.
 * @nullable labelName non-null only for breaks within labels.
 */
void tryMinimizeExits(Node n,int exitType,String labelName){
  if (matchingExitNode(n,exitType,labelName)) {
    NodeUtil.removeChild(n.getParent(),n);
    compiler.reportCodeChange();
    return;
  }
  if (n.isIf()) {
    Node ifBlock=n.getFirstChild().getNext();
    tryMinimizeExits(ifBlock,exitType,labelName);
    Node elseBlock=ifBlock.getNext();
    if (elseBlock != null) {
      tryMinimizeExits(elseBlock,exitType,labelName);
    }
    return;
  }
  if (n.isTry()) {
    Node tryBlock=n.getFirstChild();
    tryMinimizeExits(tryBlock,exitType,labelName);
    Node allCatchNodes=NodeUtil.getCatchBlock(n);
    if (NodeUtil.hasCatchHandler(allCatchNodes)) {
      Preconditions.checkState(allCatchNodes.hasOneChild());
      Node catchNode=allCatchNodes.getFirstChild();
      Node catchCodeBlock=catchNode.getLastChild();
      tryMinimizeExits(catchCodeBlock,exitType,labelName);
    }
    if (NodeUtil.hasFinally(n)) {
      Node finallyBlock=n.getLastChild();
      tryMinimizeExits(finallyBlock,exitType,labelName);
    }
  }
  if (n.isLabel()) {
    Node labelBlock=n.getLastChild();
    tryMinimizeExits(labelBlock,exitType,labelName);
  }
  if (!n.isBlock() || n.getLastChild() == null) {
    return;
  }
  for (  Node c : n.children()) {
    if (c.isIf()) {
      Node ifTree=c;
      Node trueBlock, falseBlock;
      trueBlock=ifTree.getFirstChild().getNext();
      falseBlock=trueBlock.getNext();
      tryMinimizeIfBlockExits(trueBlock,falseBlock,ifTree,exitType,labelName);
      trueBlock=ifTree.getFirstChild().getNext();
      falseBlock=trueBlock.getNext();
      if (falseBlock != null) {
        tryMinimizeIfBlockExits(falseBlock,trueBlock,ifTree,exitType,labelName);
      }
    }
    if (c == n.getLastChild()) {
      break;
    }
  }
  for (Node c=n.getLastChild(); c != null; c=n.getLastChild()) {
    tryMinimizeExits(c,exitType,labelName);
    if (c == n.getLastChild()) {
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * Attempts to minimize the number of explicit exit points in a control structure to take advantage of the implied exit at the end of the structure.  This is accomplished by removing redundant statements, and moving statements following a qualifying IF node into that node. For example: function () { if (x) return; else blah(); foo(); } becomes: function () { if (x) ; else { blah(); foo(); }
 * @param n The execution node of a parent to inspect.
 * @param exitType The type of exit to look for.
 * @param labelName If parent is a label the name of the label to look for,null otherwise.
 * @nullable labelName non-null only for breaks within labels.
 */
void tryMinimizeExits(Node n,int exitType,String labelName){
  if (matchingExitNode(n,exitType,labelName)) {
    NodeUtil.removeChild(n.getParent(),n);
    compiler.reportCodeChange();
    return;
  }
  if (n.isIf()) {
    Node ifBlock=n.getFirstChild().getNext();
    tryMinimizeExits(ifBlock,exitType,labelName);
    Node elseBlock=ifBlock.getNext();
    if (elseBlock != null) {
      tryMinimizeExits(elseBlock,exitType,labelName);
    }
    return;
  }
  if (n.isTry()) {
    Node tryBlock=n.getFirstChild();
    tryMinimizeExits(tryBlock,exitType,labelName);
    Node allCatchNodes=NodeUtil.getCatchBlock(n);
    if (NodeUtil.hasCatchHandler(allCatchNodes)) {
      Preconditions.checkState(allCatchNodes.hasOneChild());
      Node catchNode=allCatchNodes.getFirstChild();
      Node catchCodeBlock=catchNode.getLastChild();
      tryMinimizeExits(catchCodeBlock,exitType,labelName);
    }
  }
  if (n.isLabel()) {
    Node labelBlock=n.getLastChild();
    tryMinimizeExits(labelBlock,exitType,labelName);
  }
  if (!n.isBlock() || n.getLastChild() == null) {
    return;
  }
  for (  Node c : n.children()) {
    if (c.isIf()) {
      Node ifTree=c;
      Node trueBlock, falseBlock;
      trueBlock=ifTree.getFirstChild().getNext();
      falseBlock=trueBlock.getNext();
      tryMinimizeIfBlockExits(trueBlock,falseBlock,ifTree,exitType,labelName);
      trueBlock=ifTree.getFirstChild().getNext();
      falseBlock=trueBlock.getNext();
      if (falseBlock != null) {
        tryMinimizeIfBlockExits(falseBlock,trueBlock,ifTree,exitType,labelName);
      }
    }
    if (c == n.getLastChild()) {
      break;
    }
  }
  for (Node c=n.getLastChild(); c != null; c=n.getLastChild()) {
    tryMinimizeExits(c,exitType,labelName);
    if (c == n.getLastChild()) {
      break;
    }
  }
}