Program: 133234
Project: 133234
Buggy source:
@Override public void startForeachLoop(Var arrayVar,Var memberVar,Var loopCountVar,int splitDegree,boolean arrayClosed,List<Var> usedVariables,List<Var> keepOpenVars){
  assert(Types.isArray(arrayVar.type()));
  assert(loopCountVar == null || loopCountVar.type().equals(Types.V_INT));
  int foreach_num=foreach_counter++;
  String procName="String_Node_Str" + foreach_num;
  if (!arrayClosed) {
    ArrayList<Var> passIn=new ArrayList<Var>(usedVariables);
    if (!passIn.contains(arrayVar)) {
      passIn.add(arrayVar);
    }
    startAsync(procName,Arrays.asList(arrayVar),passIn,keepOpenVars,false);
  }
  boolean haveKeys=loopCountVar != null;
  String contentsVar=TCLTMP_ARRAY_CONTENTS;
  if (splitDegree <= 0) {
    pointStack.peek().add(Turbine.containerContents(contentsVar,varToExpr(arrayVar),haveKeys));
  }
 else {
    pointStack.peek().add(Turbine.containerSize(TCLTMP_CONTAINER_SIZE,varToExpr(arrayVar)));
    Expression lastIndex=Square.arithExpr(new Value(TCLTMP_CONTAINER_SIZE),new Token("String_Node_Str"),new LiteralInt(1));
    ArrayList<Var> splitUsedVars=new ArrayList<Var>(usedVariables);
    splitUsedVars.add(arrayVar);
    startRangeSplit(procName,splitUsedVars,keepOpenVars,splitDegree,new LiteralInt(0),lastIndex,new LiteralInt(1));
    pointStack.peek().add(new SetVariable(TCLTMP_SPLITLEN,Square.arithExpr(new Token(String.format("String_Node_Str",TCLTMP_RANGE_HI,TCLTMP_RANGE_LO)))));
    pointStack.peek().add(Turbine.containerContents(contentsVar,varToExpr(arrayVar),haveKeys,new Value(TCLTMP_SPLITLEN),TCLTMP_RANGE_LO_V));
  }
  startForeachInner(new Value(contentsVar),memberVar,loopCountVar,true,usedVariables,keepOpenVars,foreach_num);
}

Fixed version (ground truth):
@Override public void startForeachLoop(String loopName,Var arrayVar,Var memberVar,Var loopCountVar,int splitDegree,boolean arrayClosed,List<Var> usedVariables,List<Var> keepOpenVars){
  assert(Types.isArray(arrayVar.type()));
  assert(loopCountVar == null || loopCountVar.type().equals(Types.V_INT));
  int foreach_num=foreach_counter++;
  String procName="String_Node_Str" + foreach_num;
  if (!arrayClosed) {
    ArrayList<Var> passIn=new ArrayList<Var>(usedVariables);
    if (!passIn.contains(arrayVar)) {
      passIn.add(arrayVar);
    }
    startAsync(procName,Arrays.asList(arrayVar),passIn,keepOpenVars,false);
  }
  boolean haveKeys=loopCountVar != null;
  String contentsVar=TCLTMP_ARRAY_CONTENTS;
  if (splitDegree <= 0) {
    pointStack.peek().add(Turbine.containerContents(contentsVar,varToExpr(arrayVar),haveKeys));
  }
 else {
    pointStack.peek().add(Turbine.containerSize(TCLTMP_CONTAINER_SIZE,varToExpr(arrayVar)));
    Expression lastIndex=Square.arithExpr(new Value(TCLTMP_CONTAINER_SIZE),new Token("String_Node_Str"),new LiteralInt(1));
    ArrayList<Var> splitUsedVars=new ArrayList<Var>(usedVariables);
    splitUsedVars.add(arrayVar);
    startRangeSplit(procName,splitUsedVars,keepOpenVars,splitDegree,new LiteralInt(0),lastIndex,new LiteralInt(1));
    pointStack.peek().add(new SetVariable(TCLTMP_SPLITLEN,Square.arithExpr(new Token(String.format("String_Node_Str",TCLTMP_RANGE_HI,TCLTMP_RANGE_LO)))));
    pointStack.peek().add(Turbine.containerContents(contentsVar,varToExpr(arrayVar),haveKeys,new Value(TCLTMP_SPLITLEN),TCLTMP_RANGE_LO_V));
  }
  startForeachInner(new Value(contentsVar),memberVar,loopCountVar,true,usedVariables,keepOpenVars,foreach_num);
}