Program: 133001
Project: 133001
Buggy source:
/** 
 * @param logger
 * @param ancestorBlock the block the instructions are moved from
 * @param ancestors 
 * @param currBlock the block they are moved too (a descendant of the priorblock)
 * @param currContext 
 * @param currBlockInstructions  all changes to instructions in curr blockare made through this iterator, and it is rewound to the previous position before the function exits
 * @param waitMap map of variable names to instructions/continuations they blockon
 * @param writtenV
 * @return true if change made, list of moved continuations
 */
private static Pair<Boolean,Set<Continuation>> relocateDependentInstructions(Logger logger,Block ancestorBlock,ExecContext ancestorContext,Deque<Continuation> ancestors,Block currBlock,ExecContext currContext,ListIterator<Instruction> currBlockInstructions,MultiMap<Var,InstOrCont> waitMap,Var writtenV){
  boolean changed=false;
  List<InstOrCont> waits=waitMap.get(writtenV);
  Set<Instruction> movedI=new HashSet<Instruction>();
  Set<Continuation> movedC=new HashSet<Continuation>();
  for (  InstOrCont ic : waits) {
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + ic.toString());
    boolean relocated;
switch (ic.type()) {
case CONTINUATION:
{
        relocated=relocateContinuation(ancestors,currBlock,currContext,movedC,ic.continuation());
        break;
      }
case INSTRUCTION:
    relocated=relocateInstruction(ancestors,currContext,currBlockInstructions,movedI,ic.instruction());
  break;
default :
throw new STCRuntimeError("String_Node_Str");
}
changed=changed || relocated;
}
ancestorBlock.removeContinuations(movedC);
ancestorBlock.removeInstructions(movedI);
ICUtil.rewindIterator(currBlockInstructions,movedI.size());
updateWaiterMap(waitMap,movedC,movedI);
return Pair.create(changed,movedC);
}

Fixed version (ground truth):
/** 
 * @param logger
 * @param ancestorBlock the block the instructions are moved from
 * @param ancestors 
 * @param currBlock the block they are moved too (a descendant of the priorblock)
 * @param currContext 
 * @param currBlockInstructions  all changes to instructions in curr blockare made through this iterator, and it is rewound to the previous position before the function exits
 * @param waitMap map of variable names to instructions/continuations they blockon
 * @param writtenV
 * @return true if change made, list of moved continuations
 */
private Pair<Boolean,Set<Continuation>> relocateDependentInstructions(Logger logger,Block ancestorBlock,ExecContext ancestorContext,Deque<Continuation> ancestors,Block currBlock,ExecContext currContext,ListIterator<Instruction> currBlockInstructions,MultiMap<Var,InstOrCont> waitMap,Var writtenV){
  boolean changed=false;
  List<InstOrCont> waits=waitMap.get(writtenV);
  Set<Instruction> movedI=new HashSet<Instruction>();
  Set<Continuation> movedC=new HashSet<Continuation>();
  for (  InstOrCont ic : waits) {
    if (logger.isTraceEnabled())     logger.trace("String_Node_Str" + ic.toString());
    boolean relocated;
switch (ic.type()) {
case CONTINUATION:
{
        relocated=relocateContinuation(ancestors,currBlock,currContext,movedC,ic.continuation());
        break;
      }
case INSTRUCTION:
    relocated=relocateInstruction(ancestors,currContext,currBlockInstructions,movedI,ic.instruction());
  break;
default :
throw new STCRuntimeError("String_Node_Str");
}
changed=changed || relocated;
}
ancestorBlock.removeContinuations(movedC);
ancestorBlock.removeInstructions(movedI);
ICUtil.rewindIterator(currBlockInstructions,movedI.size());
updateWaiterMap(waitMap,movedC,movedI);
return Pair.create(changed,movedC);
}