Program: 132828
Project: 132828
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,FunctionType concrete,List<Var> oList,List<Var> iList,TaskProps props) throws UserException {
  props.assertInternalTypesValid();
  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);
  if (context.isIntrinsic(function)) {
    IntrinsicFunction intF=context.lookupIntrinsic(function);
    backend.intrinsicCall(intF,backendIList,backendOList,props);
  }
 else   if (context.hasFunctionProp(function,FnProp.BUILTIN)) {
    if (ForeignFunctions.hasOpEquiv(function)) {
      assert(oList.size() <= 1);
      Var backendOut=(backendOList.size() == 0 ? null : backendOList.get(0));
      backend.asyncOp(ForeignFunctions.getOpEquiv(function),backendOut,Arg.fromVarList(backendIList),props);
    }
 else {
      backend.builtinFunctionCall(function,backendOList,oList,props);
    }
  }
 else   if (context.hasFunctionProp(function,FnProp.COMPOSITE)) {
    TaskMode mode;
    if (context.hasFunctionProp(function,FnProp.SYNC)) {
      mode=TaskMode.SYNC;
    }
 else {
      mode=TaskMode.CONTROL;
    }
    backend.functionCall(function,Var.asArgList(backendIList),backendOList,mode,props);
  }
 else {
    backendCallWrapped(context,function,concrete,backendOList,backendIList,props);
  }
}

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,FunctionType concrete,List<Var> oList,List<Var> iList,TaskProps props) throws UserException {
  props.assertInternalTypesValid();
  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);
  if (context.isIntrinsic(function)) {
    IntrinsicFunction intF=context.lookupIntrinsic(function);
    backend.intrinsicCall(intF,backendIList,backendOList,props);
  }
 else   if (context.hasFunctionProp(function,FnProp.BUILTIN)) {
    if (ForeignFunctions.hasOpEquiv(function)) {
      assert(oList.size() <= 1);
      Var backendOut=(backendOList.size() == 0 ? null : backendOList.get(0));
      backend.asyncOp(ForeignFunctions.getOpEquiv(function),backendOut,Arg.fromVarList(backendIList),props);
    }
 else {
      backend.builtinFunctionCall(function,backendIList,backendOList,props);
    }
  }
 else   if (context.hasFunctionProp(function,FnProp.COMPOSITE)) {
    TaskMode mode;
    if (context.hasFunctionProp(function,FnProp.SYNC)) {
      mode=TaskMode.SYNC;
    }
 else {
      mode=TaskMode.CONTROL;
    }
    backend.functionCall(function,Var.asArgList(backendIList),backendOList,mode,props);
  }
 else {
    backendCallWrapped(context,function,concrete,backendOList,backendIList,props);
  }
}