Program: 136129
Project: 136129
Buggy source:
/** 
 * Return an OpArgNode constructed from a GeneralId tree to be used in the RHS of a substitution
 */
private OpArgNode generateOpArg(SymbolNode targetSymbol,TreeNode opArgSyntaxNode,ModuleNode mn) throws AbortException {
  if (opArgSyntaxNode.isKind(N_Lambda)) {
    return new OpArgNode(generateLambda(opArgSyntaxNode,mn),opArgSyntaxNode,mn);
  }
  ;
  if (!(opArgSyntaxNode.isKind(N_GeneralId) || opArgSyntaxNode.isKind(N_GenInfixOp) || opArgSyntaxNode.isKind(N_GenPrefixOp)|| opArgSyntaxNode.isKind(N_GenNonExpPrefixOp)|| opArgSyntaxNode.isKind(N_GenPostfixOp))) {
    errors.addError(opArgSyntaxNode.getLocation(),"String_Node_Str" + targetSymbol.getArity() + "String_Node_Str"+ "String_Node_Str"+ targetSymbol.getName()+ "String_Node_Str");
    return nullOpArg;
  }
  if (opArgSyntaxNode.getKind() == N_GeneralId) {
    if (targetSymbol.getArity() <= 0) {
      errors.addAbort(opArgSyntaxNode.getLocation(),"String_Node_Str",true);
    }
    ;
    return (OpArgNode)selectorToNode(genIdToSelector((SyntaxTreeNode)opArgSyntaxNode),targetSymbol.getArity(),false,false,mn);
  }
  ;
  GenID genID=generateGenID(opArgSyntaxNode,mn);
  if (genID.getFullyQualifiedOp() != null && genID.getArgs().length == 0) {
    return new OpArgNode(genID.getFullyQualifiedOp(),opArgSyntaxNode,mn);
  }
 else   if (genID.getArgs().length > 0) {
    errors.addError(opArgSyntaxNode.getLocation(),"String_Node_Str" + targetSymbol.getArity() + "String_Node_Str"+ "String_Node_Str"+ targetSymbol.getName()+ "String_Node_Str");
    return nullOpArg;
  }
 else {
    return nullOpArg;
  }
}

Fixed version (ground truth):
/** 
 * Return an OpArgNode constructed from a GeneralId tree to be used in the RHS of a substitution
 */
private OpArgNode generateOpArg(SymbolNode targetSymbol,TreeNode opArgSyntaxNode,ModuleNode mn) throws AbortException {
  if (opArgSyntaxNode.isKind(N_Lambda)) {
    return new OpArgNode(generateLambda(opArgSyntaxNode,mn),opArgSyntaxNode,mn);
  }
  ;
  if (!(opArgSyntaxNode.isKind(N_GeneralId) || opArgSyntaxNode.isKind(N_GenInfixOp) || opArgSyntaxNode.isKind(N_GenPrefixOp)|| opArgSyntaxNode.isKind(N_GenNonExpPrefixOp)|| opArgSyntaxNode.isKind(N_GenPostfixOp))) {
    errors.addError(opArgSyntaxNode.getLocation(),"String_Node_Str" + targetSymbol.getArity() + "String_Node_Str"+ "String_Node_Str"+ targetSymbol.getName()+ "String_Node_Str");
    return nullOpArg;
  }
  if (opArgSyntaxNode.getKind() == N_GeneralId) {
    if (targetSymbol.getArity() <= 0) {
      errors.addAbort(opArgSyntaxNode.getLocation(),"String_Node_Str",true);
    }
    ;
    LevelNode ln=selectorToNode(genIdToSelector((SyntaxTreeNode)opArgSyntaxNode),targetSymbol.getArity(),false,false,mn);
    if (!(ln instanceof OpArgNode)) {
      if (errors.getNumErrors() > 0) {
        return nullOpArg;
      }
      errors.addAbort(opArgSyntaxNode.getLocation(),"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    ;
    return (OpArgNode)ln;
  }
  ;
  GenID genID=generateGenID(opArgSyntaxNode,mn);
  if (genID.getFullyQualifiedOp() != null && genID.getArgs().length == 0) {
    return new OpArgNode(genID.getFullyQualifiedOp(),opArgSyntaxNode,mn);
  }
 else   if (genID.getArgs().length > 0) {
    errors.addError(opArgSyntaxNode.getLocation(),"String_Node_Str" + targetSymbol.getArity() + "String_Node_Str"+ "String_Node_Str"+ targetSymbol.getName()+ "String_Node_Str");
    return nullOpArg;
  }
 else {
    return nullOpArg;
  }
}