Program: 40598
Project: 40598
Buggy source:
public void handleTrackedPointsToWorklist(){
  while (!trackedPointsToWorklist.isEmpty()) {
    incrementNumNodesTraversed();
    final PointerKeyAndState curPkAndState=trackedPointsToWorklist.iterator().next();
    trackedPointsToWorklist.remove(curPkAndState);
    final PointerKey curPk=curPkAndState.getPointerKey();
    final State curState=curPkAndState.getState();
    if (DEBUG)     Trace.println("String_Node_Str" + curPkAndState);
    final MutableIntSet trackedSet=find(pkToTrackedSet,curPkAndState);
    IFlowLabelVisitor succVisitor=new AbstractFlowLabelVisitor(){
      @Override public void visitPutField(      PutFieldLabel label,      Object dst){
        IField field=label.getField();
        if (refineFieldAccesses(field)) {
          for (          InstanceKeyAndState ikAndState : makeOrdinalSet(trackedSet)) {
            boolean needField=forwInstKeyToFields.get(ikAndState).contains(field);
            PointerKeyAndState storeDst=new PointerKeyAndState((PointerKey)dst,curState);
            encounteredStores.add(new StoreEdge(curPkAndState,field,storeDst));
            if (needField) {
              if (!addToInitWorklist(storeDst)) {
                InstanceFieldKeyAndState ifk=getInstFieldKey(ikAndState,field);
                findOrCreate(instFieldKeyToP2Set,ifk).addAll(find(pkToP2Set,storeDst));
              }
            }
          }
        }
      }
    }
;
    g.visitSuccs(curPk,succVisitor);
    IFlowLabelVisitor predVisitor=new AbstractFlowLabelVisitor(){
      @Override public void visitAssignGlobal(      AssignGlobalLabel label,      Object dst){
        for (Iterator<? extends Object> readIter=g.getReadsOfStaticField((StaticFieldKey)dst); readIter.hasNext(); ) {
          final PointerKey predPk=(PointerKey)readIter.next();
          doTransition(curState,AssignGlobalBarLabel.v(),new Function<State,Object>(){
            public Object apply(            State predPkState){
              PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,predPkState);
              if (findOrCreate(pkToTrackedSet,predPkAndState).addAll(trackedSet)) {
                addToTrackedPToWorklist(predPkAndState);
              }
              return null;
            }
          }
);
        }
      }
      @Override public void visitPutField(      PutFieldLabel label,      Object dst){
        IField field=label.getField();
        if (refineFieldAccesses(field)) {
          PointerKeyAndState storeBase=new PointerKeyAndState((PointerKey)dst,curState);
          encounteredStores.add(new StoreEdge(storeBase,field,curPkAndState));
          if (!addToInitWorklist(storeBase)) {
            for (            InstanceKeyAndState ikAndState : makeOrdinalSet(find(pkToP2Set,storeBase))) {
              InstanceFieldKeyAndState ifk=getInstFieldKey(ikAndState,field);
              findOrCreate(instFieldKeyToTrackedSet,ifk).addAll(trackedSet);
              trackInstanceField(ikAndState,field,backInstKeyToFields);
            }
          }
        }
 else {
          for (Iterator<PointerKey> readIter=g.getReadsOfInstanceField(field); readIter.hasNext(); ) {
            final PointerKey predPk=readIter.next();
            doTransition(curState,MatchBarLabel.v(),new Function<State,Object>(){
              public Object apply(              State predPkState){
                PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,predPkState);
                if (findOrCreate(pkToTrackedSet,predPkAndState).addAll(trackedSet)) {
                  addToTrackedPToWorklist(predPkAndState);
                }
                return null;
              }
            }
);
          }
        }
      }
      @Override public void visitGetField(      GetFieldLabel label,      Object dst){
        IField field=label.getField();
        if (refineFieldAccesses(field)) {
          for (          InstanceKeyAndState ikAndState : makeOrdinalSet(trackedSet)) {
            boolean needField=backInstKeyToFields.get(ikAndState).contains(field);
            PointerKeyAndState loadedVal=new PointerKeyAndState((PointerKey)dst,curState);
            addEncounteredLoad(new LoadEdge(curPkAndState,field,loadedVal));
            if (needField) {
              InstanceFieldKeyAndState ifk=getInstFieldKey(ikAndState,field);
              if (findOrCreate(pkToTrackedSet,loadedVal).addAll(find(instFieldKeyToTrackedSet,ifk))) {
                addToTrackedPToWorklist(loadedVal);
              }
            }
          }
        }
      }
      @Override public void visitAssign(      AssignLabel label,      Object dst){
        final PointerKey predPk=(PointerKey)dst;
        doTransition(curState,AssignBarLabel.v(),new Function<State,Object>(){
          public Object apply(          State predPkState){
            PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,predPkState);
            if (findOrCreate(pkToTrackedSet,predPkAndState).addAll(trackedSet)) {
              addToTrackedPToWorklist(predPkAndState);
            }
            return null;
          }
        }
);
      }
    }
;
    g.visitPreds(curPk,predVisitor);
    handleBackInterproc(curPkAndState,new CopyHandler(){
      @Override void handle(      PointerKeyAndState src,      final PointerKey dst,      IFlowLabel label){
        if (Assertions.verifyAssertions) {
          Assertions._assert(src == curPkAndState);
        }
        doTransition(curState,label,new Function<State,Object>(){
          public Object apply(          State dstState){
            PointerKeyAndState dstAndState=new PointerKeyAndState(dst,dstState);
            if (findOrCreate(pkToTrackedSet,dstAndState).addAll(trackedSet)) {
              addToTrackedPToWorklist(dstAndState);
            }
            return null;
          }
        }
);
      }
    }
,true);
  }
}

Fixed version (ground truth):
public void handleTrackedPointsToWorklist(){
  while (!trackedPointsToWorklist.isEmpty()) {
    incrementNumNodesTraversed();
    final PointerKeyAndState curPkAndState=trackedPointsToWorklist.iterator().next();
    trackedPointsToWorklist.remove(curPkAndState);
    final PointerKey curPk=curPkAndState.getPointerKey();
    final State curState=curPkAndState.getState();
    if (DEBUG)     Trace.println("String_Node_Str" + curPkAndState);
    final MutableIntSet trackedSet=find(pkToTrackedSet,curPkAndState);
    IFlowLabelVisitor succVisitor=new AbstractFlowLabelVisitor(){
      @Override public void visitPutField(      PutFieldLabel label,      Object dst){
        IField field=label.getField();
        if (refineFieldAccesses(field)) {
          for (          InstanceKeyAndState ikAndState : makeOrdinalSet(trackedSet)) {
            boolean needField=forwInstKeyToFields.get(ikAndState).contains(field);
            PointerKeyAndState storeDst=new PointerKeyAndState((PointerKey)dst,curState);
            encounteredStores.add(new StoreEdge(curPkAndState,field,storeDst));
            if (needField) {
              if (!addToInitWorklist(storeDst)) {
                InstanceFieldKeyAndState ifk=getInstFieldKey(ikAndState,field);
                findOrCreate(instFieldKeyToP2Set,ifk).addAll(find(pkToP2Set,storeDst));
              }
            }
          }
        }
      }
    }
;
    g.visitSuccs(curPk,succVisitor);
    IFlowLabelVisitor predVisitor=new AbstractFlowLabelVisitor(){
      @Override public void visitAssignGlobal(      AssignGlobalLabel label,      Object dst){
        for (Iterator<? extends Object> readIter=g.getReadsOfStaticField((StaticFieldKey)dst); readIter.hasNext(); ) {
          final PointerKey predPk=(PointerKey)readIter.next();
          doTransition(curState,AssignGlobalBarLabel.v(),new Function<State,Object>(){
            public Object apply(            State predPkState){
              PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,predPkState);
              if (findOrCreate(pkToTrackedSet,predPkAndState).addAll(trackedSet)) {
                addToTrackedPToWorklist(predPkAndState);
              }
              return null;
            }
          }
);
        }
      }
      @Override public void visitPutField(      PutFieldLabel label,      Object dst){
        IField field=label.getField();
        if (refineFieldAccesses(field)) {
          PointerKeyAndState storeBase=new PointerKeyAndState((PointerKey)dst,curState);
          encounteredStores.add(new StoreEdge(storeBase,field,curPkAndState));
          if (!addToInitWorklist(storeBase)) {
            for (            InstanceKeyAndState ikAndState : makeOrdinalSet(find(pkToP2Set,storeBase))) {
              InstanceFieldKeyAndState ifk=getInstFieldKey(ikAndState,field);
              findOrCreate(instFieldKeyToTrackedSet,ifk).addAll(trackedSet);
              trackInstanceField(ikAndState,field,backInstKeyToFields);
            }
          }
        }
 else {
          for (Iterator<PointerKey> readIter=g.getReadsOfInstanceField(field); readIter.hasNext(); ) {
            final PointerKey predPk=readIter.next();
            doTransition(curState,MatchBarLabel.v(),new Function<State,Object>(){
              public Object apply(              State predPkState){
                PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,predPkState);
                if (findOrCreate(pkToTrackedSet,predPkAndState).addAll(trackedSet)) {
                  addToTrackedPToWorklist(predPkAndState);
                }
                return null;
              }
            }
);
          }
        }
      }
      @Override public void visitGetField(      GetFieldLabel label,      Object dst){
        IField field=label.getField();
        if (refineFieldAccesses(field)) {
          for (          InstanceKeyAndState ikAndState : makeOrdinalSet(trackedSet)) {
            boolean needField=backInstKeyToFields.get(ikAndState).contains(field);
            PointerKeyAndState loadedVal=new PointerKeyAndState((PointerKey)dst,curState);
            addEncounteredLoad(new LoadEdge(curPkAndState,field,loadedVal));
            if (needField) {
              InstanceFieldKeyAndState ifk=getInstFieldKey(ikAndState,field);
              if (findOrCreate(pkToTrackedSet,loadedVal).addAll(find(instFieldKeyToTrackedSet,ifk))) {
                addToTrackedPToWorklist(loadedVal);
              }
            }
          }
        }
      }
      @Override public void visitAssign(      AssignLabel label,      Object dst){
        final PointerKey predPk=(PointerKey)dst;
        doTransition(curState,AssignBarLabel.noFilter(),new Function<State,Object>(){
          public Object apply(          State predPkState){
            PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,predPkState);
            if (findOrCreate(pkToTrackedSet,predPkAndState).addAll(trackedSet)) {
              addToTrackedPToWorklist(predPkAndState);
            }
            return null;
          }
        }
);
      }
    }
;
    g.visitPreds(curPk,predVisitor);
    handleBackInterproc(curPkAndState,new CopyHandler(){
      @Override void handle(      PointerKeyAndState src,      final PointerKey dst,      IFlowLabel label){
        if (Assertions.verifyAssertions) {
          Assertions._assert(src == curPkAndState);
        }
        doTransition(curState,label,new Function<State,Object>(){
          public Object apply(          State dstState){
            PointerKeyAndState dstAndState=new PointerKeyAndState(dst,dstState);
            if (findOrCreate(pkToTrackedSet,dstAndState).addAll(trackedSet)) {
              addToTrackedPToWorklist(dstAndState);
            }
            return null;
          }
        }
);
      }
    }
,true);
  }
}