Program: 62118
Project: 62118
Buggy source:
private void restoreControlFlowPass(ConstantPool constants,MethodBody body,boolean secondpass){
  try {
    HashMap<Integer,List<Integer>> refs;
    int visited2[]=new int[code.size()];
    refs=visitCode(body);
    HashMap<Integer,List<Object>> appended=new HashMap<>();
{
      restoreControlFlow(0,refs,visited2,appended);
      for (      ABCException e : body.exceptions) {
        try {
          restoreControlFlow(adr2pos(e.start),refs,visited2,appended);
          restoreControlFlow(adr2pos(e.target),refs,visited2,appended);
          restoreControlFlow(adr2pos(e.end),refs,visited2,appended);
        }
 catch (        ConvertException ex) {
          Logger.getLogger(AVM2Code.class.getName()).log(Level.FINE,null,ex);
        }
      }
    }
    for (    int ip : appended.keySet()) {
      code.get(ip).replaceWith=appended.get(ip);
    }
  }
 catch (  ConvertException cex) {
    cex.printStackTrace();
  }
  invalidateCache();
  try {
    List<Integer> outputMap=new ArrayList<>();
    String src=Highlighting.stripHilights(toASMSource(constants,body,outputMap,false));
    AVM2Code acode=ASM3Parser.parse(new ByteArrayInputStream(src.getBytes("String_Node_Str")),constants,null,body);
    for (int i=0; i < acode.code.size(); i++) {
      if (outputMap.size() > i) {
        int tpos=outputMap.get(i);
        if (tpos == -1) {
        }
 else         if (code.get(tpos).mappedOffset >= 0) {
          acode.code.get(i).mappedOffset=code.get(tpos).mappedOffset;
        }
 else {
          acode.code.get(i).mappedOffset=pos2adr(tpos);
        }
      }
    }
    this.code=acode.code;
  }
 catch (  IOException ex) {
    Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  ParseException ex) {
    Logger.getLogger(AVM2Code.class.getName()).log(Level.FINE,null,ex);
  }
  invalidateCache();
  removeDeadCode(constants,body);
}

Fixed version (ground truth):
private void restoreControlFlowPass(ConstantPool constants,MethodBody body,boolean secondpass){
  try {
    HashMap<Integer,List<Integer>> refs;
    int visited2[]=new int[code.size()];
    refs=visitCode(body);
    HashMap<Integer,List<Object>> appended=new HashMap<>();
{
      restoreControlFlow(0,refs,visited2,appended);
      for (      ABCException e : body.exceptions) {
        try {
          restoreControlFlow(adr2pos(e.start),refs,visited2,appended);
          restoreControlFlow(adr2pos(e.target),refs,visited2,appended);
          restoreControlFlow(adr2pos(e.end),refs,visited2,appended);
        }
 catch (        ConvertException ex) {
          Logger.getLogger(AVM2Code.class.getName()).log(Level.FINE,null,ex);
        }
      }
    }
    for (    int ip : appended.keySet()) {
      code.get(ip).replaceWith=appended.get(ip);
    }
  }
 catch (  ConvertException cex) {
    Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE,"String_Node_Str",cex);
  }
  invalidateCache();
  try {
    List<Integer> outputMap=new ArrayList<>();
    String src=Highlighting.stripHilights(toASMSource(constants,body,outputMap,false));
    AVM2Code acode=ASM3Parser.parse(new ByteArrayInputStream(src.getBytes("String_Node_Str")),constants,null,body);
    for (int i=0; i < acode.code.size(); i++) {
      if (outputMap.size() > i) {
        int tpos=outputMap.get(i);
        if (tpos == -1) {
        }
 else         if (code.get(tpos).mappedOffset >= 0) {
          acode.code.get(i).mappedOffset=code.get(tpos).mappedOffset;
        }
 else {
          acode.code.get(i).mappedOffset=pos2adr(tpos);
        }
      }
    }
    this.code=acode.code;
  }
 catch (  IOException ex) {
    Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE,null,ex);
  }
catch (  ParseException ex) {
    Logger.getLogger(AVM2Code.class.getName()).log(Level.FINE,null,ex);
  }
  invalidateCache();
  removeDeadCode(constants,body);
}