Program: 78277
Project: 78277
Buggy source:
private Operand visitArithComp(Operand left,ExprOps op,Operand right,TypeSymbol type){
  Operand leftVal=getVal(left);
  Operand rightVal=getVal(right);
  if (leftVal instanceof Literal && rightVal instanceof Literal) {
    return literalCalc(leftVal,op,rightVal);
  }
  Var dst=Var.tmpBuilder(op.toString(),op.isCompare());
  if (type != BaseTypeSymbol.STRING_TYPE_SYMBOL) {
    return currentBasicBlock.pushBack(new BinaryExprInst(dst,leftVal,op,rightVal),valTag);
  }
  List<Operand> args=new ArrayList<>(Arrays.asList(leftVal,rightVal));
  if (op == ADD) {
    if (left.equals(EMPTY_STRING))     return right;
 else     if (right.equals(EMPTY_STRING))     return left;
    return currentBasicBlock.pushBack(new FunctionCallInst(Function.STR_ADD,args,dst),valTag);
  }
  currentBasicBlock.pushBack(new FunctionCallInst(Function.STR_CMP,args,dst),valTag);
  Var cmp=Var.tmpBuilder("String_Node_Str" + op.toString(),true);
switch (op) {
case GT:
    return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,GT,ZERO_LITERAL),valTag);
case LT:
  return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,LT,ZERO_LITERAL),valTag);
case GTE:
return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,GTE,ZERO_LITERAL),valTag);
case LTE:
return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,LTE,ZERO_LITERAL),valTag);
case EQ:
return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,EQ,ZERO_LITERAL),valTag);
case NEQ:
return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,NEQ,ZERO_LITERAL),valTag);
default :
throw new RuntimeException("String_Node_Str");
}
}

Fixed version (ground truth):
private Operand visitArithComp(Operand left,ExprOps op,Operand right,TypeSymbol type){
  Operand leftVal=getVal(left);
  Operand rightVal=getVal(right);
  if (leftVal instanceof Literal && rightVal instanceof Literal) {
    try {
      return literalCalc(leftVal,op,rightVal);
    }
 catch (    ArithmeticException e) {
      System.err.println("String_Node_Str" + e.getMessage());
    }
  }
  Var dst=Var.tmpBuilder(op.toString(),op.isCompare());
  if (type != BaseTypeSymbol.STRING_TYPE_SYMBOL) {
    return currentBasicBlock.pushBack(new BinaryExprInst(dst,leftVal,op,rightVal),valTag);
  }
  List<Operand> args=new ArrayList<>(Arrays.asList(leftVal,rightVal));
  if (op == ADD) {
    if (left.equals(EMPTY_STRING))     return right;
 else     if (right.equals(EMPTY_STRING))     return left;
    return currentBasicBlock.pushBack(new FunctionCallInst(Function.STR_ADD,args,dst),valTag);
  }
  currentBasicBlock.pushBack(new FunctionCallInst(Function.STR_CMP,args,dst),valTag);
  Var cmp=Var.tmpBuilder("String_Node_Str" + op.toString(),true);
switch (op) {
case GT:
    return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,GT,ZERO_LITERAL),valTag);
case LT:
  return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,LT,ZERO_LITERAL),valTag);
case GTE:
return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,GTE,ZERO_LITERAL),valTag);
case LTE:
return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,LTE,ZERO_LITERAL),valTag);
case EQ:
return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,EQ,ZERO_LITERAL),valTag);
case NEQ:
return currentBasicBlock.pushBack(new BinaryExprInst(cmp,dst,NEQ,ZERO_LITERAL),valTag);
default :
throw new RuntimeException("String_Node_Str");
}
}