Program: 132716
Project: 132716
Buggy source:
/** 
 * Attempt to explode individual instruction
 * @param logger
 * @param fn
 * @param execCx
 * @param block
 * @param it
 * @param inst
 * @param waitedFor any vars waited for, e.g. in outer exploded.  This preventsinfinite cycles of exploding if we didn't change instruction
 * @return true if exploded
 */
private static boolean tryExplode(Logger logger,Function fn,ExecContext execCx,Block block,ListIterator<Statement> it,Instruction inst,HierarchicalSet<Var> waitedFor){
  MakeImmRequest req=inst.canMakeImmediate(waitedFor,Collections.<ArgCV>emptySet(),Collections.<Var>emptySet(),true);
  if (req != null && req.in.size() > 0) {
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str" + inst + "String_Node_Str"+ fn.getName());
    }
    it.remove();
    List<Pair<Var,Ternary>> waitVars=new ArrayList<Pair<Var,Ternary>>();
    Map<Var,Var> filenameMap=new HashMap<Var,Var>();
    OptUtil.buildWaitVars(block,it,req.in,req.out,filenameMap,waitVars);
    Block insideWaitBlock=enterWaits(fn,execCx,block,inst,req,waitVars);
    List<Statement> instBuffer=new ArrayList<Statement>();
    List<Arg> inVals=OptUtil.fetchMakeImmInputs(insideWaitBlock,req.in,instBuffer);
    List<Var> localOutputs=OptUtil.createMakeImmOutputs(insideWaitBlock,req.out,filenameMap,instBuffer);
    MakeImmChange change=inst.makeImmediate(new OptVarCreator(insideWaitBlock),Fetched.makeList(req.out,localOutputs,true),Fetched.makeList(req.in,inVals,false));
    OptUtil.fixupImmChange(block,insideWaitBlock,inst,change,instBuffer,localOutputs,req.out);
    insideWaitBlock.addStatements(instBuffer);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Attempt to explode individual instruction
 * @param logger
 * @param fn
 * @param execCx
 * @param block
 * @param it
 * @param inst
 * @param waitedFor any vars waited for, e.g. in outer exploded.  This preventsinfinite cycles of exploding if we didn't change instruction
 * @return true if exploded
 */
private static boolean tryExplode(Logger logger,Function fn,ExecContext execCx,Block block,ListIterator<Statement> it,Instruction inst,HierarchicalSet<Var> waitedFor){
  MakeImmRequest req=inst.canMakeImmediate(waitedFor,Collections.<ArgCV>emptySet(),Collections.<Var>emptySet(),true);
  if (req != null && req.in.size() > 0) {
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str" + inst + "String_Node_Str"+ fn.getName());
    }
    it.remove();
    List<Pair<Var,Ternary>> waitVars=new ArrayList<Pair<Var,Ternary>>();
    Map<Var,Var> filenameMap=new HashMap<Var,Var>();
    OptUtil.buildWaitVars(block,it,req.in,req.out,filenameMap,waitVars);
    Block insideWaitBlock=enterWaits(fn,execCx,block,inst,req,waitVars);
    List<Statement> instBuffer=new ArrayList<Statement>();
    List<Arg> inVals=OptUtil.fetchMakeImmInputs(insideWaitBlock,req.in,instBuffer);
    List<Var> localOutputs=OptUtil.createMakeImmOutputs(insideWaitBlock,req.out,filenameMap,instBuffer);
    MakeImmChange change=inst.makeImmediate(new OptVarCreator(insideWaitBlock),Fetched.makeList(req.out,localOutputs,true),Fetched.makeList(req.in,inVals,false));
    OptUtil.fixupImmChange(fn.getName(),block,insideWaitBlock,inst,change,instBuffer,localOutputs,req.out);
    insideWaitBlock.addStatements(instBuffer);
    return true;
  }
  return false;
}