Program: 132941
Project: 132941
Buggy source:
/** 
 * @param logger
 * @param program
 * @param fn
 * @param execCx
 * @param cont
 * @param cv
 * @param replaceInputs
 * @param replaceAll
 * @return any variables that are guaranteed to be closed in currentcontext after continuation is evaluated
 * @throws InvalidOptionException
 * @throws InvalidWriteException
 */
private UnifiedState recurseOnContinuation(Logger logger,Program program,Function fn,ExecContext execCx,Continuation cont,State cv,HierarchicalMap<Var,Arg> replaceInputs,HierarchicalMap<Var,Arg> replaceAll) throws InvalidOptionException, InvalidWriteException {
  State contCV=cv.makeChild(cont.inheritsParentVars());
  List<BlockingVar> contClosedVars=cont.blockingVars(true);
  if (contClosedVars != null) {
    for (    BlockingVar bv : contClosedVars) {
      contCV.close(bv.var,bv.recursive);
    }
  }
  boolean unifyBranches=cont.isExhaustiveSyncConditional();
  List<State> branchStates=unifyBranches ? new ArrayList<State>() : null;
  List<Block> contBlocks=cont.getBlocks();
  for (int i=0; i < contBlocks.size(); i++) {
    HierarchicalMap<Var,Arg> contReplaceInputs;
    HierarchicalMap<Var,Arg> contReplaceAll;
    if (cont.inheritsParentVars()) {
      contReplaceInputs=replaceInputs;
      contReplaceAll=replaceAll;
    }
 else {
      contReplaceInputs=replaceInputs.makeChildMap();
      contReplaceAll=replaceAll.makeChildMap();
      purgeUnpassableVars(contReplaceInputs);
      purgeUnpassableVars(contReplaceAll);
    }
    State blockCV;
    boolean again;
    int pass=1;
    do {
      logger.debug("String_Node_Str" + pass);
      blockCV=contCV.makeChild(true);
      again=forwardDataflow(logger,program,fn,cont.childContext(execCx),contBlocks.get(i),blockCV,contReplaceInputs.makeChildMap(),contReplaceAll.makeChildMap());
      pass++;
    }
 while (again);
    if (unifyBranches) {
      branchStates.add(blockCV);
    }
  }
  if (unifyBranches) {
    return UnifiedState.unify(cv,branchStates);
  }
 else {
    return UnifiedState.EMPTY;
  }
}

Fixed version (ground truth):
/** 
 * @param logger
 * @param program
 * @param fn
 * @param execCx
 * @param cont
 * @param cv
 * @param replaceInputs
 * @param replaceAll
 * @return any variables that are guaranteed to be closed in currentcontext after continuation is evaluated
 * @throws InvalidOptionException
 * @throws InvalidWriteException
 */
private UnifiedState recurseOnContinuation(Logger logger,Program program,Function fn,ExecContext execCx,Continuation cont,State cv,HierarchicalMap<Var,Arg> replaceInputs,HierarchicalMap<Var,Arg> replaceAll) throws InvalidOptionException, InvalidWriteException {
  logger.trace("String_Node_Str" + cont.getType());
  State contCV=cv.makeChild(cont.inheritsParentVars());
  List<BlockingVar> contClosedVars=cont.blockingVars(true);
  if (contClosedVars != null) {
    for (    BlockingVar bv : contClosedVars) {
      contCV.close(bv.var,bv.recursive);
    }
  }
  boolean unifyBranches=cont.isExhaustiveSyncConditional();
  List<State> branchStates=unifyBranches ? new ArrayList<State>() : null;
  List<Block> contBlocks=cont.getBlocks();
  for (int i=0; i < contBlocks.size(); i++) {
    HierarchicalMap<Var,Arg> contReplaceInputs;
    HierarchicalMap<Var,Arg> contReplaceAll;
    if (cont.inheritsParentVars()) {
      contReplaceInputs=replaceInputs;
      contReplaceAll=replaceAll;
    }
 else {
      contReplaceInputs=replaceInputs.makeChildMap();
      contReplaceAll=replaceAll.makeChildMap();
      purgeUnpassableVars(contReplaceInputs);
      purgeUnpassableVars(contReplaceAll);
    }
    State blockCV;
    boolean again;
    int pass=1;
    do {
      logger.debug("String_Node_Str" + pass);
      blockCV=contCV.makeChild(true);
      again=forwardDataflow(logger,program,fn,cont.childContext(execCx),contBlocks.get(i),blockCV,contReplaceInputs.makeChildMap(),contReplaceAll.makeChildMap());
      pass++;
    }
 while (again);
    if (unifyBranches) {
      branchStates.add(blockCV);
    }
  }
  if (unifyBranches) {
    return UnifiedState.unify(cv,branchStates);
  }
 else {
    return UnifiedState.EMPTY;
  }
}