Program: 62085
Project: 62085
Buggy source:
public String toASMSource(ConstantPool constants,MethodBody body,List<Integer> outputMap,boolean hex){
  invalidateCache();
  StringBuffer ret=new StringBuffer();
  String t="String_Node_Str";
  for (int e=0; e < body.exceptions.length; e++) {
    ret.append("String_Node_Str" + e + "String_Node_Str"+ body.exceptions[e].name_index+ "String_Node_Str"+ Helper.escapeString(body.exceptions[e].getVarName(constants,new ArrayList<String>()))+ "String_Node_Str"+ "String_Node_Str"+ body.exceptions[e].type_index+ "String_Node_Str"+ Helper.escapeString(body.exceptions[e].getTypeName(constants,new ArrayList<String>()))+ "String_Node_Str");
  }
  List<Long> offsets=new ArrayList<>();
  for (  AVM2Instruction ins : code) {
    offsets.addAll(ins.getOffsets());
  }
  for (  AVM2Instruction ins : code) {
    if (ins.replaceWith != null) {
      for (      Object o : ins.replaceWith) {
        if (o instanceof ControlFlowTag) {
          ControlFlowTag cft=(ControlFlowTag)o;
          if (cft.name.equals("String_Node_Str")) {
            offsets.add((long)pos2adr(cft.value));
          }
        }
      }
    }
  }
  long ofs=0;
  int ip=0;
  int largeLimit=20000;
  boolean markOffsets=code.size() <= largeLimit;
  for (  AVM2Instruction ins : code) {
    if (hex) {
      ret.append("String_Node_Str");
      ret.append(Helper.bytesToHexString(ins.getBytes()));
      ret.append("String_Node_Str");
    }
    if (ins.labelname != null) {
      ret.append(ins.labelname + "String_Node_Str");
    }
 else     if (offsets.contains(ofs)) {
      ret.append("String_Node_Str" + Helper.formatAddress(ofs) + "String_Node_Str");
    }
    for (int e=0; e < body.exceptions.length; e++) {
      if (body.exceptions[e].start == ofs) {
        ret.append("String_Node_Str" + e + "String_Node_Str");
      }
      if (body.exceptions[e].end == ofs) {
        ret.append("String_Node_Str" + e + "String_Node_Str");
      }
      if (body.exceptions[e].target == ofs) {
        ret.append("String_Node_Str" + e + "String_Node_Str");
      }
    }
    if (ins.replaceWith != null) {
      for (      Object o : ins.replaceWith) {
        if (o instanceof Integer) {
          AVM2Instruction ins2=code.get((Integer)o);
          if (ins2.isIgnored()) {
            continue;
          }
          t=Highlighting.hilighOffset("String_Node_Str",ins2.mappedOffset > -1 ? ins2.mappedOffset : ofs) + ins2.toStringNoAddress(constants,new ArrayList<String>()) + "String_Node_Str"+ Helper.formatAddress(pos2adr((Integer)o))+ "String_Node_Str";
          ret.append(t);
          outputMap.add((Integer)o);
        }
 else         if (o instanceof ControlFlowTag) {
          ControlFlowTag cft=(ControlFlowTag)o;
          if (cft.name.equals("String_Node_Str")) {
            t="String_Node_Str" + Helper.formatAddress(pos2adr(cft.value)) + "String_Node_Str";
            ret.append(t);
            outputMap.add(-1);
          }
          if (cft.name.equals("String_Node_Str")) {
            ret.append("String_Node_Str" + Helper.formatAddress(pos2adr(cft.value)) + "String_Node_Str");
          }
        }
      }
    }
 else {
      if (!ins.isIgnored()) {
        int fixBranch=ins.getFixBranch();
        if (fixBranch > -1) {
          if (ins.definition instanceof IfTypeIns) {
            t=new PopIns().instructionName + "String_Node_Str";
            if (fixBranch == 0) {
              t+=new JumpIns().instructionName + "String_Node_Str" + Helper.formatAddress(ofs + ins.getBytes().length + ins.operands[0]);
            }
 else {
            }
          }
        }
 else {
          t=ins.toStringNoAddress(constants,new ArrayList<String>());
          if (ins.changeJumpTo > -1) {
            t=ins.definition.instructionName + "String_Node_Str" + Helper.formatAddress(pos2adr(ins.changeJumpTo));
          }
        }
        if (markOffsets) {
          t=Highlighting.hilighOffset("String_Node_Str",ins.mappedOffset > -1 ? ins.mappedOffset : ofs) + t + "String_Node_Str";
        }
 else {
          t=t + "String_Node_Str";
        }
        ret.append(t);
        outputMap.add(ip);
      }
    }
    ofs+=ins.getBytes().length;
    ip++;
  }
  String r=ret.toString();
  return r;
}

Fixed version (ground truth):
public String toASMSource(ConstantPool constants,MethodBody body,List<Integer> outputMap,boolean hex){
  invalidateCache();
  StringBuffer ret=new StringBuffer();
  String t="String_Node_Str";
  for (int e=0; e < body.exceptions.length; e++) {
    ret.append("String_Node_Str" + e + "String_Node_Str"+ body.exceptions[e].name_index+ "String_Node_Str"+ Helper.escapeString(body.exceptions[e].getVarName(constants,new ArrayList<String>()))+ "String_Node_Str"+ "String_Node_Str"+ body.exceptions[e].type_index+ "String_Node_Str"+ Helper.escapeString(body.exceptions[e].getTypeName(constants,new ArrayList<String>()))+ "String_Node_Str");
  }
  List<Long> offsets=new ArrayList<>();
  for (  AVM2Instruction ins : code) {
    offsets.addAll(ins.getOffsets());
  }
  for (  AVM2Instruction ins : code) {
    if (ins.replaceWith != null) {
      for (      Object o : ins.replaceWith) {
        if (o instanceof ControlFlowTag) {
          ControlFlowTag cft=(ControlFlowTag)o;
          if (cft.name.equals("String_Node_Str")) {
            offsets.add((long)pos2adr(cft.value));
          }
        }
      }
    }
  }
  long ofs=0;
  int ip=0;
  int largeLimit=20000;
  boolean markOffsets=code.size() <= largeLimit;
  for (  AVM2Instruction ins : code) {
    if (hex) {
      ret.append("String_Node_Str");
      ret.append(Helper.bytesToHexString(ins.getBytes()));
      ret.append("String_Node_Str");
    }
    if (ins.labelname != null) {
      ret.append(ins.labelname + "String_Node_Str");
    }
 else     if (offsets.contains(ofs)) {
      ret.append("String_Node_Str" + Helper.formatAddress(ofs) + "String_Node_Str");
    }
    for (int e=0; e < body.exceptions.length; e++) {
      if (body.exceptions[e].start == ofs) {
        ret.append("String_Node_Str" + e + "String_Node_Str");
      }
      if (body.exceptions[e].end == ofs) {
        ret.append("String_Node_Str" + e + "String_Node_Str");
      }
      if (body.exceptions[e].target == ofs) {
        ret.append("String_Node_Str" + e + "String_Node_Str");
      }
    }
    if (ins.replaceWith != null) {
      for (      Object o : ins.replaceWith) {
        if (o instanceof Integer) {
          AVM2Instruction ins2=code.get((Integer)o);
          if (ins2.isIgnored()) {
            continue;
          }
          t=Highlighting.hilighOffset("String_Node_Str",ins2.mappedOffset > -1 ? ins2.mappedOffset : ofs) + ins2.toStringNoAddress(constants,new ArrayList<String>()) + "String_Node_Str"+ Helper.formatAddress(pos2adr((Integer)o))+ "String_Node_Str";
          ret.append(t);
          outputMap.add((Integer)o);
        }
 else         if (o instanceof ControlFlowTag) {
          ControlFlowTag cft=(ControlFlowTag)o;
          if (cft.name.equals("String_Node_Str")) {
            t="String_Node_Str" + Helper.formatAddress(pos2adr(cft.value)) + "String_Node_Str";
            ret.append(t);
            outputMap.add(-1);
          }
          if (cft.name.equals("String_Node_Str")) {
            ret.append("String_Node_Str" + Helper.formatAddress(pos2adr(cft.value)) + "String_Node_Str");
          }
        }
      }
    }
 else {
      if (!ins.isIgnored()) {
        int fixBranch=ins.getFixBranch();
        if (fixBranch > -1) {
          if (ins.definition instanceof IfTypeIns) {
            t="String_Node_Str";
            for (int i=0; i < -ins.definition.getStackDelta(ins,null); i++) {
              t+=new PopIns().instructionName + "String_Node_Str";
            }
            if (fixBranch == 0) {
              t+=new JumpIns().instructionName + "String_Node_Str" + Helper.formatAddress(ofs + ins.getBytes().length + ins.operands[0]);
            }
 else {
            }
          }
        }
 else {
          t=ins.toStringNoAddress(constants,new ArrayList<String>());
          if (ins.changeJumpTo > -1) {
            t=ins.definition.instructionName + "String_Node_Str" + Helper.formatAddress(pos2adr(ins.changeJumpTo));
          }
        }
        if (markOffsets) {
          t=Highlighting.hilighOffset("String_Node_Str",ins.mappedOffset > -1 ? ins.mappedOffset : ofs) + t + "String_Node_Str";
        }
 else {
          t=t + "String_Node_Str";
        }
        ret.append(t);
        outputMap.add(ip);
      }
    }
    ofs+=ins.getBytes().length;
    ip++;
  }
  String r=ret.toString();
  return r;
}