Program: 61524
Project: 61524
Buggy source:
private int visitCode(Reference<AVM2Instruction> assignment,Set<Integer> visited,TranslateStack stack,int classIndex,boolean isStatic,MethodBody body,int scriptIndex,ABC abc,AVM2Code code,int idx,int endIdx,ExecutionResult result,Set<Integer> ignored,Set<Integer> ignoredGets) throws InterruptedException {
  List<GraphTargetItem> output=new ArrayList<>();
  AVM2LocalData localData=newLocalData(scriptIndex,abc,abc.constants,body,isStatic,classIndex);
  localData.localRegs.put(0,new NullAVM2Item(null));
  List<Integer> toVisit=new ArrayList<>();
  toVisit.add(idx);
  List<TranslateStack> toVisitStacks=new ArrayList<>();
  toVisitStacks.add(stack);
  while (!toVisit.isEmpty()) {
    idx=toVisit.remove(0);
    stack=toVisitStacks.remove(0);
    try {
      while (true) {
        if (idx > endIdx) {
          break;
        }
        if (visited.contains(idx)) {
          break;
        }
        visited.add(idx);
        AVM2Instruction ins=code.code.get(idx);
        InstructionDefinition def=ins.definition;
        ins.translate(localData,stack,output,Graph.SOP_USE_STATIC,"String_Node_Str");
        if (def instanceof SetLocalTypeIns) {
          int regId=((SetLocalTypeIns)def).getRegisterId(ins);
          if (!ignored.contains(regId)) {
            assignment.setVal(ins);
            return regId;
          }
        }
 else         if (def instanceof GetLocalTypeIns) {
          int regId=((GetLocalTypeIns)def).getRegisterId(ins);
          if (!ignored.contains(regId) && !ignoredGets.contains(regId)) {
            assignment.setVal(ins);
            return regId;
          }
        }
 else {
          for (int p=0; p < ins.definition.operands.length; p++) {
            int op=ins.definition.operands[p];
            if (op == AVM2Code.DAT_REGISTER_INDEX) {
              int regId=ins.operands[p];
              if (!ignored.contains(regId)) {
                assignment.setVal(ins);
                return regId;
              }
            }
          }
        }
        idx++;
        if (ins.definition instanceof JumpIns) {
          long address=ins.offset + ins.getBytesLength() + ins.operands[0];
          idx=code.adr2pos(address);
          if (idx == -1) {
            throw new TranslateException("String_Node_Str" + address);
          }
        }
        if (ins.isBranch()) {
          List<Integer> branches=ins.getBranches(new GraphSource(){
            @Override public int size(){
              throw new UnsupportedOperationException("String_Node_Str");
            }
            @Override public GraphSourceItem get(            int pos){
              throw new UnsupportedOperationException("String_Node_Str");
            }
            @Override public boolean isEmpty(){
              throw new UnsupportedOperationException("String_Node_Str");
            }
            @Override public List<GraphTargetItem> translatePart(            GraphPart part,            BaseLocalData localData,            TranslateStack stack,            int start,            int end,            int staticOperation,            String path) throws InterruptedException {
              throw new UnsupportedOperationException("String_Node_Str");
            }
            @Override public int adr2pos(            long adr){
              return code.adr2pos(adr);
            }
            @Override public long pos2adr(            int pos){
              return code.pos2adr(pos);
            }
          }
);
          idx=branches.get(0);
          for (int n=1; n < branches.size(); n++) {
            int nidx=branches.get(n);
            if (visited.contains(nidx)) {
              continue;
            }
            toVisit.add(nidx);
            toVisitStacks.add((TranslateStack)stack.clone());
          }
        }
        if (ins.definition instanceof ReturnValueIns) {
          break;
        }
        if (ins.definition instanceof ThrowIns) {
          break;
        }
        if (ins.definition instanceof ReturnVoidIns) {
          break;
        }
      }
    }
 catch (    InterruptedException ex) {
      throw ex;
    }
catch (    Throwable ex) {
    }
  }
  return -1;
}

Fixed version (ground truth):
private int visitCode(Reference<AVM2Instruction> assignment,Set<Integer> visited,TranslateStack stack,int classIndex,boolean isStatic,MethodBody body,int scriptIndex,ABC abc,AVM2Code code,int idx,int endIdx,ExecutionResult result,Set<Integer> ignored,Set<Integer> ignoredGets) throws InterruptedException {
  List<GraphTargetItem> output=new ArrayList<>();
  AVM2LocalData localData=newLocalData(scriptIndex,abc,abc.constants,body,isStatic,classIndex);
  localData.localRegs.put(0,new NullAVM2Item(null));
  List<Integer> toVisit=new ArrayList<>();
  toVisit.add(idx);
  List<TranslateStack> toVisitStacks=new ArrayList<>();
  toVisitStacks.add(stack);
  while (!toVisit.isEmpty()) {
    idx=toVisit.remove(0);
    stack=toVisitStacks.remove(0);
    try {
      while (true) {
        if (idx > endIdx) {
          break;
        }
        if (visited.contains(idx)) {
          break;
        }
        visited.add(idx);
        AVM2Instruction ins=code.code.get(idx);
        InstructionDefinition def=ins.definition;
        ins.translate(localData,stack,output,Graph.SOP_USE_STATIC,"String_Node_Str");
        if (def instanceof SetLocalTypeIns) {
          int regId=((SetLocalTypeIns)def).getRegisterId(ins);
          if (!ignored.contains(regId)) {
            assignment.setVal(ins);
            return regId;
          }
        }
 else         if (def instanceof GetLocalTypeIns) {
          int regId=((GetLocalTypeIns)def).getRegisterId(ins);
          if (!ignored.contains(regId) && !ignoredGets.contains(regId)) {
            assignment.setVal(ins);
            return regId;
          }
        }
 else {
          for (int p=0; p < ins.definition.operands.length; p++) {
            int op=ins.definition.operands[p];
            if (op == AVM2Code.DAT_REGISTER_INDEX) {
              int regId=ins.operands[p];
              if (!ignored.contains(regId)) {
                assignment.setVal(ins);
                return regId;
              }
            }
          }
        }
        idx++;
        if (ins.definition instanceof JumpIns) {
          long address=ins.offset + ins.getBytesLength() + ins.operands[0];
          idx=code.adr2pos(address);
          if (idx == -1) {
            throw new TranslateException("String_Node_Str" + address);
          }
        }
        if (ins.isBranch()) {
          List<Integer> branches=ins.getBranches(new GraphSource(){
            @Override public int size(){
              throw new UnsupportedOperationException("String_Node_Str");
            }
            @Override public GraphSourceItem get(            int pos){
              throw new UnsupportedOperationException("String_Node_Str");
            }
            @Override public boolean isEmpty(){
              throw new UnsupportedOperationException("String_Node_Str");
            }
            @Override public List<GraphTargetItem> translatePart(            GraphPart part,            BaseLocalData localData,            TranslateStack stack,            int start,            int end,            int staticOperation,            String path) throws InterruptedException {
              throw new UnsupportedOperationException("String_Node_Str");
            }
            @Override public int adr2pos(            long adr){
              return code.adr2pos(adr);
            }
            @Override public long pos2adr(            int pos){
              return code.pos2adr(pos);
            }
          }
);
          idx=branches.get(0);
          for (int n=1; n < branches.size(); n++) {
            int nidx=branches.get(n);
            if (visited.contains(nidx)) {
              continue;
            }
            toVisit.add(nidx);
            toVisitStacks.add((TranslateStack)stack.clone());
          }
        }
        if (ins.definition instanceof ReturnValueIns) {
          break;
        }
        if (ins.definition instanceof ThrowIns) {
          break;
        }
        if (ins.definition instanceof ReturnVoidIns) {
          break;
        }
      }
    }
 catch (    ThreadDeath|InterruptedException ex) {
      throw ex;
    }
catch (    Throwable ex) {
    }
  }
  return -1;
}