Program: 132615
Project: 132615
Buggy source:
/** 
 * Generate backend instruction for function call
 * @param context
 * @param function name of function
 * @param oList list of output variables
 * @param iList list of input variables (with correct types)
 * @param priorityVal optional priority value (can be null)
 * @throws UserException
 */
private void backendFunctionCall(Context context,String function,FunctionCallKind kind,FunctionType concrete,List<Var> oList,List<Var> iList,TaskProps props) throws UserException {
  props.assertInternalTypesValid();
  if (kind == FunctionCallKind.STRUCT_CONSTRUCTOR) {
    backendStructConstructor(context,function,concrete,oList,iList);
    return;
  }
  assert(kind == FunctionCallKind.REGULAR_FUNCTION);
  FunctionType def=context.lookupFunction(function);
  if (def == null) {
    throw new STCRuntimeError("String_Node_Str" + "String_Node_Str" + function);
  }
  if (context.hasFunctionProp(function,FnProp.DEPRECATED)) {
    LogHelper.warn(context,"String_Node_Str" + function);
  }
  List<Var> backendIList=VarRepr.backendVars(iList);
  List<Var> backendOList=VarRepr.backendVars(oList);
  TaskProps backendProps=VarRepr.backendProps(props);
  if (context.isIntrinsic(function)) {
    IntrinsicFunction intF=context.lookupIntrinsic(function);
    backend.intrinsicCall(intF,backendIList,backendOList,backendProps);
  }
 else   if (context.hasFunctionProp(function,FnProp.BUILTIN)) {
    ForeignFunctions foreignFuncs=context.getForeignFunctions();
    if (foreignFuncs.hasOpEquiv(function)) {
      assert(oList.size() <= 1);
      Var backendOut=(backendOList.size() == 0 ? null : backendOList.get(0));
      backend.asyncOp(foreignFuncs.getOpEquiv(function),backendOut,Arg.fromVarList(backendIList),backendProps);
    }
 else {
      backend.builtinFunctionCall(function,function,backendIList,backendOList,backendProps);
    }
  }
 else   if (context.hasFunctionProp(function,FnProp.COMPOSITE)) {
    ExecTarget mode;
    if (context.hasFunctionProp(function,FnProp.SYNC)) {
      mode=ExecTarget.syncControl();
    }
 else {
      mode=ExecTarget.dispatchedControl();
    }
    backend.functionCall(function,function,Var.asArgList(backendIList),backendOList,mode,backendProps);
  }
 else {
    backendCallWrapped(context,function,concrete,backendOList,backendIList,backendProps);
  }
}

Fixed version (ground truth):
/** 
 * Generate backend instruction for function call
 * @param context
 * @param function name of function
 * @param oList list of output variables
 * @param iList list of input variables (with correct types)
 * @param priorityVal optional priority value (can be null)
 * @throws UserException
 */
private void backendFunctionCall(Context context,String function,FunctionCallKind kind,FunctionType concrete,List<Var> oList,List<Var> iList,TaskProps props) throws UserException {
  props.assertInternalTypesValid();
  if (kind == FunctionCallKind.STRUCT_CONSTRUCTOR) {
    backendStructConstructor(context,function,concrete,oList,iList);
    return;
  }
 else   if (kind == FunctionCallKind.SUBTYPE_CONSTRUCTOR) {
    backendSubtypeConstructor(context,function,concrete,oList,iList);
    return;
  }
  assert(kind == FunctionCallKind.REGULAR_FUNCTION);
  FunctionType def=context.lookupFunction(function);
  if (def == null) {
    throw new STCRuntimeError("String_Node_Str" + "String_Node_Str" + function);
  }
  if (context.hasFunctionProp(function,FnProp.DEPRECATED)) {
    LogHelper.warn(context,"String_Node_Str" + function);
  }
  List<Var> backendIList=VarRepr.backendVars(iList);
  List<Var> backendOList=VarRepr.backendVars(oList);
  TaskProps backendProps=VarRepr.backendProps(props);
  if (context.isIntrinsic(function)) {
    IntrinsicFunction intF=context.lookupIntrinsic(function);
    backend.intrinsicCall(intF,backendIList,backendOList,backendProps);
  }
 else   if (context.hasFunctionProp(function,FnProp.BUILTIN)) {
    ForeignFunctions foreignFuncs=context.getForeignFunctions();
    if (foreignFuncs.hasOpEquiv(function)) {
      assert(oList.size() <= 1);
      Var backendOut=(backendOList.size() == 0 ? null : backendOList.get(0));
      backend.asyncOp(foreignFuncs.getOpEquiv(function),backendOut,Arg.fromVarList(backendIList),backendProps);
    }
 else {
      backend.builtinFunctionCall(function,function,backendIList,backendOList,backendProps);
    }
  }
 else   if (context.hasFunctionProp(function,FnProp.COMPOSITE)) {
    ExecTarget mode;
    if (context.hasFunctionProp(function,FnProp.SYNC)) {
      mode=ExecTarget.syncControl();
    }
 else {
      mode=ExecTarget.dispatchedControl();
    }
    backend.functionCall(function,function,Var.asArgList(backendIList),backendOList,mode,backendProps);
  }
 else {
    backendCallWrapped(context,function,concrete,backendOList,backendIList,backendProps);
  }
}