Program: 132616
Project: 132616
Buggy source:
/** 
 * Call wrapper function for app or wrapped builtin
 * @param context
 * @param function
 * @param concrete
 * @param backendOList
 * @param backendIList
 * @param props
 * @throws UserException
 */
private void backendCallWrapped(Context context,String function,FunctionType concrete,List<Var> backendOList,List<Var> backendIList,TaskProps props) throws UserException {
  String wrapperFnName;
  if (context.hasFunctionProp(function,FnProp.WRAPPED_BUILTIN)) {
    wrapperFnName=wrappers.generateWrapper(context,function,concrete);
  }
 else {
    assert(context.hasFunctionProp(function,FnProp.APP));
    wrapperFnName=function;
  }
  List<Arg> realInputs=new ArrayList<Arg>();
  for (  Var in : backendIList) {
    realInputs.add(in.asArg());
  }
  if (context.hasFunctionProp(function,FnProp.PARALLEL)) {
    Arg par=props.get(TaskPropKey.PARALLELISM);
    if (par == null) {
      throw new UserException(context,"String_Node_Str" + "String_Node_Str" + function);
    }
    realInputs.add(VarRepr.backendArg(par));
  }
  if (context.hasFunctionProp(function,FnProp.TARGETABLE)) {
    Arg location=props.getWithDefault(TaskPropKey.LOCATION);
    realInputs.add(VarRepr.backendArg(location));
    Arg softLocation=props.getWithDefault(TaskPropKey.SOFT_LOCATION);
    realInputs.add(VarRepr.backendArg(softLocation));
  }
  assert(context.hasFunctionProp(function,FnProp.SYNC));
  ExecTarget mode=ExecTarget.syncControl();
  backend.functionCall(wrapperFnName,function,realInputs,backendOList,mode,VarRepr.backendProps(props));
}

Fixed version (ground truth):
/** 
 * Call wrapper function for app or wrapped builtin
 * @param context
 * @param function
 * @param concrete
 * @param backendOList
 * @param backendIList
 * @param props
 * @throws UserException
 */
private void backendCallWrapped(Context context,String function,FunctionType concrete,List<Var> backendOList,List<Var> backendIList,TaskProps props) throws UserException {
  String wrapperFnName;
  if (context.hasFunctionProp(function,FnProp.WRAPPED_BUILTIN)) {
    wrapperFnName=wrappers.generateWrapper(context,function,concrete);
  }
 else {
    assert(context.hasFunctionProp(function,FnProp.APP));
    wrapperFnName=function;
  }
  List<Arg> realInputs=new ArrayList<Arg>();
  for (  Var in : backendIList) {
    realInputs.add(in.asArg());
  }
  if (context.hasFunctionProp(function,FnProp.PARALLEL)) {
    Arg par=props.get(TaskPropKey.PARALLELISM);
    if (par == null) {
      throw new UserException(context,"String_Node_Str" + "String_Node_Str" + function);
    }
    realInputs.add(VarRepr.backendArg(par));
  }
  if (context.hasFunctionProp(function,FnProp.TARGETABLE)) {
    Arg location=props.getWithDefault(TaskPropKey.LOC_RANK);
    realInputs.add(VarRepr.backendArg(location));
    Arg locStrictness=props.getWithDefault(TaskPropKey.LOC_STRICTNESS);
    realInputs.add(VarRepr.backendArg(locStrictness));
    Arg locAccuracy=props.getWithDefault(TaskPropKey.LOC_ACCURACY);
    realInputs.add(VarRepr.backendArg(locAccuracy));
  }
  assert(context.hasFunctionProp(function,FnProp.SYNC));
  ExecTarget mode=ExecTarget.syncControl();
  backend.functionCall(wrapperFnName,function,realInputs,backendOList,mode,VarRepr.backendProps(props));
}