Program: 99618
Project: 99618
Buggy source:
public static void processCallingConstraintsInternal(AstSSAPropagationCallGraphBuilder builder,CGNode caller,SSAAbstractInvokeInstruction instruction,CGNode target,InstanceKey[][] constParams,PointerKey uniqueCatchKey){
  IRView sourceIR=builder.getCFAContextInterpreter().getIRView(caller);
  SymbolTable sourceST=sourceIR.getSymbolTable();
  IRView targetIR=builder.getCFAContextInterpreter().getIRView(target);
  SymbolTable targetST=targetIR.getSymbolTable();
  JSConstraintVisitor targetVisitor=null;
  int av=-1;
  for (int v=0; v <= targetST.getMaxValueNumber(); v++) {
    String[] vns=targetIR.getLocalNames(1,v);
    for (int n=0; vns != null && n < vns.length; n++) {
      if ("String_Node_Str".equals(vns[n])) {
        av=v;
        targetVisitor=(JSConstraintVisitor)builder.makeVisitor(target);
        break;
      }
    }
  }
  int paramCount=targetST.getParameterValueNumbers().length;
  int argCount=instruction.getNumberOfParameters();
  int num_pseudoargs=2;
  for (int i=0; i < Math.min(paramCount,argCount); i++) {
    InstanceKey[] fn=new InstanceKey[]{builder.getInstanceKeyForConstant(JavaScriptTypes.String,"String_Node_Str" + (i - num_pseudoargs))};
    PointerKey F=builder.getTargetPointerKey(target,i);
    if (constParams != null && constParams[i] != null) {
      for (int j=0; j < constParams[i].length; j++) {
        builder.getSystem().newConstraint(F,constParams[i][j]);
      }
      if (av != -1 && i >= num_pseudoargs) {
        targetVisitor.newFieldWrite(target,av,fn,constParams[i]);
      }
    }
 else {
      PointerKey A=builder.getPointerKeyForLocal(caller,instruction.getUse(i));
      builder.getSystem().newConstraint(F,(F instanceof FilteredPointerKey) ? builder.filterOperator : assignOperator,A);
      if (av != -1 && i >= num_pseudoargs) {
        targetVisitor.newFieldWrite(target,av,fn,F);
      }
    }
  }
  if (paramCount < argCount) {
    if (av != -1) {
      for (int i=paramCount; i < argCount; i++) {
        InstanceKey[] fn=new InstanceKey[]{builder.getInstanceKeyForConstant(JavaScriptTypes.String,"String_Node_Str" + (i - num_pseudoargs))};
        if (constParams != null && constParams[i] != null && i >= num_pseudoargs) {
          targetVisitor.newFieldWrite(target,av,fn,constParams[i]);
        }
 else         if (i >= num_pseudoargs) {
          PointerKey A=builder.getPointerKeyForLocal(caller,instruction.getUse(i));
          targetVisitor.newFieldWrite(target,av,fn,A);
        }
      }
    }
  }
 else   if (argCount < paramCount) {
    int nullvn=sourceST.getNullConstant();
    DefUse sourceDU=builder.getCFAContextInterpreter().getDU(caller);
    InstanceKey[] nullkeys=builder.getInvariantContents(sourceST,sourceDU,caller,nullvn,builder);
    for (int i=argCount; i < paramCount; i++) {
      PointerKey F=builder.getPointerKeyForLocal(target,targetST.getParameter(i));
      for (int k=0; k < nullkeys.length; k++) {
        builder.getSystem().newConstraint(F,nullkeys[k]);
      }
    }
  }
  if (av != -1) {
    InstanceKey[] svn=new InstanceKey[]{builder.getInstanceKeyForConstant(JavaScriptTypes.Number,argCount - 1)};
    InstanceKey[] lnv=new InstanceKey[]{builder.getInstanceKeyForConstant(JavaScriptTypes.String,"String_Node_Str")};
    targetVisitor.newFieldWrite(target,av,lnv,svn);
  }
  if (instruction.getDef(0) != -1) {
    PointerKey RF=builder.getPointerKeyForReturnValue(target);
    PointerKey RA=builder.getPointerKeyForLocal(caller,instruction.getDef(0));
    builder.getSystem().newConstraint(RA,assignOperator,RF);
  }
  PointerKey EF=builder.getPointerKeyForExceptionalReturnValue(target);
  if (SHORT_CIRCUIT_SINGLE_USES && uniqueCatchKey != null) {
    builder.getSystem().newConstraint(uniqueCatchKey,assignOperator,EF);
  }
 else {
    PointerKey EA=builder.getPointerKeyForLocal(caller,instruction.getDef(1));
    builder.getSystem().newConstraint(EA,assignOperator,EF);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void processCallingConstraintsInternal(AstSSAPropagationCallGraphBuilder builder,CGNode caller,SSAAbstractInvokeInstruction instruction,CGNode target,InstanceKey[][] constParams,PointerKey uniqueCatchKey){
  IRView sourceIR=builder.getCFAContextInterpreter().getIRView(caller);
  SymbolTable sourceST=sourceIR.getSymbolTable();
  IRView targetIR=builder.getCFAContextInterpreter().getIRView(target);
  SymbolTable targetST=targetIR.getSymbolTable();
  JSConstraintVisitor targetVisitor=null;
  int av=-1;
  for (int v=0; v <= targetST.getMaxValueNumber(); v++) {
    String[] vns=targetIR.getLocalNames(1,v);
    for (int n=0; vns != null && n < vns.length; n++) {
      if ("String_Node_Str".equals(vns[n])) {
        av=v;
        targetVisitor=(JSConstraintVisitor)builder.makeVisitor(target);
        break;
      }
    }
  }
  int paramCount=targetST.getParameterValueNumbers().length;
  int argCount=instruction.getNumberOfParameters();
  int num_pseudoargs=2;
  for (int i=0; i < Math.min(paramCount,argCount); i++) {
    InstanceKey[] fn=new InstanceKey[]{builder.getInstanceKeyForConstant(JavaScriptTypes.String,"String_Node_Str" + (i - num_pseudoargs))};
    PointerKey F=builder.getTargetPointerKey(target,i);
    if (constParams != null && constParams[i] != null) {
      for (int j=0; j < constParams[i].length; j++) {
        builder.getSystem().newConstraint(F,constParams[i][j]);
      }
      if (av != -1 && i >= num_pseudoargs) {
        targetVisitor.newFieldWrite(target,av,fn,constParams[i]);
      }
    }
 else {
      PointerKey A=builder.getPointerKeyForLocal(caller,instruction.getUse(i));
      builder.getSystem().newConstraint(F,(F instanceof FilteredPointerKey) ? builder.filterOperator : assignOperator,A);
      if (av != -1 && i >= num_pseudoargs) {
        targetVisitor.newFieldWrite(target,av,fn,F);
      }
    }
  }
  if (paramCount < argCount) {
    if (av != -1) {
      for (int i=paramCount; i < argCount; i++) {
        InstanceKey[] fn=new InstanceKey[]{builder.getInstanceKeyForConstant(JavaScriptTypes.String,"String_Node_Str" + (i - num_pseudoargs))};
        if (constParams != null && constParams[i] != null && i >= num_pseudoargs) {
          targetVisitor.newFieldWrite(target,av,fn,constParams[i]);
        }
 else         if (i >= num_pseudoargs) {
          PointerKey A=builder.getPointerKeyForLocal(caller,instruction.getUse(i));
          targetVisitor.newFieldWrite(target,av,fn,A);
        }
      }
    }
  }
 else   if (argCount < paramCount) {
    int nullvn=sourceST.getNullConstant();
    DefUse sourceDU=builder.getCFAContextInterpreter().getDU(caller);
    InstanceKey[] nullkeys=builder.getInvariantContents(sourceST,sourceDU,caller,nullvn,builder);
    for (int i=argCount; i < paramCount; i++) {
      PointerKey F=builder.getPointerKeyForLocal(target,targetST.getParameter(i));
      for (int k=0; k < nullkeys.length; k++) {
        builder.getSystem().newConstraint(F,nullkeys[k]);
      }
    }
  }
  if (av != -1) {
    InstanceKey[] svn=new InstanceKey[]{builder.getInstanceKeyForConstant(JavaScriptTypes.Number,argCount - 1)};
    InstanceKey[] lnv=new InstanceKey[]{builder.getInstanceKeyForConstant(JavaScriptTypes.String,"String_Node_Str")};
    targetVisitor.newFieldWrite(target,av,lnv,svn);
  }
  if (instruction.getDef(0) != -1) {
    PointerKey RF=builder.getPointerKeyForReturnValue(target);
    PointerKey RA=builder.getPointerKeyForLocal(caller,instruction.getDef(0));
    builder.getSystem().newConstraint(RA,assignOperator,RF);
  }
  PointerKey EF=builder.getPointerKeyForExceptionalReturnValue(target);
  if (SHORT_CIRCUIT_SINGLE_USES && uniqueCatchKey != null) {
    builder.getSystem().newConstraint(uniqueCatchKey,assignOperator,EF);
  }
 else {
    PointerKey EA=builder.getPointerKeyForLocal(caller,instruction.getDef(1));
    builder.getSystem().newConstraint(EA,assignOperator,EF);
  }
}