Program: 132524
Project: 132524
Buggy source:
/** 
 * Compile the function, assuming it is already defined in context 
 */
private void compileFunction(Context context,SwiftAST tree) throws UserException {
  String function=tree.child(0).getText();
  LogHelper.debug(context,"String_Node_Str" + function);
  assert(context.isFunction(function));
  FnID id=(FnID)tree.getIdentifier();
  int numOverloads=context.lookupFunction(id.originalName()).size();
  if (numOverloads >= 2 && context.hasFunctionProp(id,FnProp.CHECKPOINTED)) {
    throw new InvalidOverloadException(context,"String_Node_Str" + "String_Node_Str");
  }
  assert(context.hasFunctionProp(id,FnProp.COMPOSITE));
  SwiftAST outputs=tree.child(2);
  SwiftAST inputs=tree.child(3);
  SwiftAST block=tree.child(4);
  FunctionDecl fdecl=FunctionDecl.fromAST(context,varCreator,exprWalker,function,inputs,outputs,Collections.<String>emptySet());
  List<Var> iList=fdecl.getInVars(context);
  List<Var> oList=fdecl.getOutVars(context);
  List<Var> backendIList=VarRepr.backendVars(iList);
  List<Var> backendOList=VarRepr.backendVars(oList);
  syncFilePos(context,tree);
  String moduleName=modules.currentModule().moduleName;
  varAnalyzer.walkFunction(context,lineMap(),moduleName,function,iList,oList,block);
  LocalContext functionContext=LocalContext.fnContext(context,function);
  functionContext.addDeclaredVariables(iList);
  functionContext.addDeclaredVariables(oList);
  ExecTarget mode=context.hasFunctionProp(id,FnProp.SYNC) ? ExecTarget.syncControl() : ExecTarget.dispatchedControl();
  backend.startFunction(id,backendOList,backendIList,mode);
  block(functionContext,block);
  backend.endFunction();
  LogHelper.debug(context,"String_Node_Str" + function);
}

Fixed version (ground truth):
/** 
 * Compile the function, assuming it is already defined in context 
 */
private void compileFunction(Context context,SwiftAST tree) throws UserException {
  String function=tree.child(0).getText();
  LogHelper.debug(context,"String_Node_Str" + function);
  assert(context.isFunction(function));
  FnID id=(FnID)tree.getIdentifier();
  int numOverloads=context.lookupFunction(id.originalName()).size();
  if (numOverloads >= 2 && context.hasFunctionProp(id,FnProp.CHECKPOINTED)) {
    throw new InvalidOverloadException(context,"String_Node_Str" + "String_Node_Str");
  }
  assert(context.hasFunctionProp(id,FnProp.COMPOSITE));
  SwiftAST outputs=tree.child(2);
  SwiftAST inputs=tree.child(3);
  SwiftAST block=tree.child(4);
  FunctionDecl fdecl=FunctionDecl.fromAST(context,varCreator,exprWalker,function,inputs,outputs,Collections.<String>emptySet());
  List<Var> iList=fdecl.getInVars(context);
  List<Var> oList=fdecl.getOutVars(context);
  List<Var> backendIList=VarRepr.backendVars(iList);
  List<Var> backendOList=VarRepr.backendVars(oList);
  syncFilePos(context,tree);
  varAnalyzer.walkFunction(context,modules.currentModule(),function,iList,oList,block);
  LocalContext functionContext=LocalContext.fnContext(context,function);
  functionContext.addDeclaredVariables(iList);
  functionContext.addDeclaredVariables(oList);
  ExecTarget mode=context.hasFunctionProp(id,FnProp.SYNC) ? ExecTarget.syncControl() : ExecTarget.dispatchedControl();
  backend.startFunction(id,backendOList,backendIList,mode);
  block(functionContext,block);
  backend.endFunction();
  LogHelper.debug(context,"String_Node_Str" + function);
}