Program: 40627
Project: 40627
Buggy source:
/** 
 * Add constraints for a call site after we have computed a reachable target for the dispatch Side effect: add edge to the call graph.
 * @param instruction
 * @param constParams if non-null, then constParams[i] holds the set of instance keys that are passed as param i, or null if param i is not invariant
 * @param uniqueCatchKey if non-null, then this is the unique PointerKey that catches all exceptions from this call site.
 */
@SuppressWarnings("String_Node_Str") private void processResolvedCall(CGNode caller,SSAAbstractInvokeInstruction instruction,CGNode target,InstanceKey[][] constParams,PointerKey uniqueCatchKey){
  if (DEBUG) {
    System.err.println("String_Node_Str" + caller + "String_Node_Str"+ instruction+ "String_Node_Str"+ target);
  }
  if (DEBUG) {
    System.err.println("String_Node_Str" + caller + "String_Node_Str"+ instruction+ "String_Node_Str"+ target);
  }
  caller.addTarget(instruction.getCallSite(),target);
  if (FakeRootMethod.isFakeRootMethod(caller.getMethod().getReference())) {
    if (entrypointCallSites.contains(instruction.getCallSite())) {
      callGraph.registerEntrypoint(target);
    }
  }
  if (!haveAlreadyVisited(target)) {
    markDiscovered(target);
  }
  int nUses=instruction.getNumberOfParameters();
  int nExpected=target.getMethod().getNumberOfParameters();
  if (nUses != nExpected) {
    Warnings.add(ResolutionFailure.create(target,instruction,"String_Node_Str" + nUses + "String_Node_Str"+ nExpected));
    return;
  }
  boolean needsFilter=!instruction.getCallSite().isStatic() && needsFilterForReceiver(instruction,target);
  for (int i=0; i < instruction.getNumberOfParameters(); i++) {
    final int vn=i + 1;
    if (target.getMethod().getParameterType(i).isReferenceType()) {
      if (constParams != null && constParams[i] != null) {
        InstanceKey[] ik=constParams[i];
        for (int j=0; j < ik.length; j++) {
          if (needsFilter && (i == 0)) {
            FilteredPointerKey.TypeFilter C=getFilter(target);
            PointerKey formal=null;
            if (isRootType(C)) {
              formal=getPointerKeyForLocal(target,vn);
            }
 else {
              formal=getFilteredPointerKeyForLocal(target,vn,C);
            }
            system.newConstraint(formal,ik[j]);
          }
 else {
            PointerKey formal=getPointerKeyForLocal(target,vn);
            system.newConstraint(formal,ik[j]);
          }
        }
      }
 else {
        if (Assertions.verifyAssertions) {
          if (instruction.getUse(i) < 0) {
            Assertions.UNREACHABLE("String_Node_Str" + instruction + "String_Node_Str"+ caller);
          }
        }
        PointerKey actual=getPointerKeyForLocal(caller,instruction.getUse(i));
        if (needsFilter && (i == 0)) {
          FilteredPointerKey.TypeFilter C=getFilter(target);
          if (isRootType(C)) {
            PointerKey formal=getPointerKeyForLocal(target,vn);
            system.newConstraint(formal,assignOperator,actual);
          }
 else {
            FilteredPointerKey formal=getFilteredPointerKeyForLocal(target,vn,C);
            system.newConstraint(formal,filterOperator,actual);
          }
        }
 else {
          PointerKey formal=getPointerKeyForLocal(target,vn);
          system.newConstraint(formal,assignOperator,actual);
        }
      }
    }
  }
  if (instruction.hasDef() && instruction.getDeclaredResultType().isReferenceType()) {
    PointerKey result=getPointerKeyForLocal(caller,instruction.getDef());
    PointerKey ret=getPointerKeyForReturnValue(target);
    system.newConstraint(result,assignOperator,ret);
  }
  PointerKey e=getPointerKeyForLocal(caller,instruction.getException());
  PointerKey er=getPointerKeyForExceptionalReturnValue(target);
  if (SHORT_CIRCUIT_SINGLE_USES && uniqueCatchKey != null) {
    system.newConstraint(uniqueCatchKey,assignOperator,er);
  }
 else {
    system.newConstraint(e,assignOperator,er);
  }
}

Fixed version (ground truth):
/** 
 * Add constraints for a call site after we have computed a reachable target for the dispatch Side effect: add edge to the call graph.
 * @param instruction
 * @param constParams if non-null, then constParams[i] holds the set of instance keys that are passed as param i, ornull if param i is not invariant
 * @param uniqueCatchKey if non-null, then this is the unique PointerKey that catches all exceptions from this callsite.
 */
@SuppressWarnings("String_Node_Str") private void processResolvedCall(CGNode caller,SSAAbstractInvokeInstruction instruction,CGNode target,InstanceKey[][] constParams,PointerKey uniqueCatchKey){
  if (DEBUG) {
    System.err.println("String_Node_Str" + caller + "String_Node_Str"+ instruction+ "String_Node_Str"+ target);
  }
  if (DEBUG) {
    System.err.println("String_Node_Str" + caller + "String_Node_Str"+ instruction+ "String_Node_Str"+ target);
  }
  caller.addTarget(instruction.getCallSite(),target);
  if (FakeRootMethod.isFakeRootMethod(caller.getMethod().getReference())) {
    if (entrypointCallSites.contains(instruction.getCallSite())) {
      callGraph.registerEntrypoint(target);
    }
  }
  if (!haveAlreadyVisited(target)) {
    markDiscovered(target);
  }
  int nUses=instruction.getNumberOfParameters();
  int nExpected=target.getMethod().getNumberOfParameters();
  if (nUses != nExpected) {
    Warnings.add(ResolutionFailure.create(target,instruction,"String_Node_Str" + nUses + "String_Node_Str"+ nExpected));
    return;
  }
  boolean needsFilter=!instruction.getCallSite().isStatic() && needsFilterForReceiver(instruction,target);
  for (int i=0; i < instruction.getNumberOfParameters(); i++) {
    final int vn=i + 1;
    if (target.getMethod().getParameterType(i).isReferenceType()) {
      if (constParams != null && constParams[i] != null) {
        InstanceKey[] ik=constParams[i];
        for (int j=0; j < ik.length; j++) {
          if (needsFilter && (i == 0)) {
            FilteredPointerKey.TypeFilter C=getFilter(target);
            PointerKey formal=null;
            if (isRootType(C)) {
              formal=getPointerKeyForLocal(target,vn);
            }
 else {
              formal=getFilteredPointerKeyForLocal(target,vn,C);
            }
            system.newConstraint(formal,ik[j]);
          }
 else {
            PointerKey formal=getPointerKeyForLocal(target,vn);
            system.newConstraint(formal,ik[j]);
          }
        }
      }
 else {
        if (Assertions.verifyAssertions) {
          if (instruction.getUse(i) < 0) {
            Assertions.UNREACHABLE("String_Node_Str" + instruction + "String_Node_Str"+ caller);
          }
        }
        PointerKey actual=getPointerKeyForLocal(caller,instruction.getUse(i));
        if (needsFilter && (i == 0)) {
          FilteredPointerKey.TypeFilter C=getFilter(target);
          if (isRootType(C)) {
            PointerKey formal=getPointerKeyForLocal(target,vn);
            system.newConstraint(formal,assignOperator,actual);
          }
 else {
            FilteredPointerKey formal=getFilteredPointerKeyForLocal(target,vn,C);
            system.newConstraint(formal,filterOperator,actual);
          }
        }
 else {
          PointerKey formal=getPointerKeyForLocal(target,vn);
          system.newConstraint(formal,assignOperator,actual);
        }
      }
    }
  }
  if (instruction.hasDef() && instruction.getDeclaredResultType().isReferenceType()) {
    PointerKey result=getPointerKeyForLocal(caller,instruction.getDef());
    PointerKey ret=getPointerKeyForReturnValue(target);
    system.newConstraint(result,assignOperator,ret);
  }
  PointerKey e=getPointerKeyForLocal(caller,instruction.getException());
  PointerKey er=getPointerKeyForExceptionalReturnValue(target);
  if (SHORT_CIRCUIT_SINGLE_USES && uniqueCatchKey != null) {
    system.newConstraint(uniqueCatchKey,assignOperator,er);
  }
 else {
    system.newConstraint(e,assignOperator,er);
  }
}