Program: 38315
Project: 38315
Buggy source:
protected void iterateCrossProduct(final CGNode caller,final CallSiteReference site,IntSet parameters,final InstanceKey[][] invariants,final VoidFunction<InstanceKey[]> f){
  final IR ir=caller.getIR();
  final int params[]=IntSetUtil.toArray(parameters);
  for (  final SSAAbstractInvokeInstruction call : ir.getCalls(site)) {
    final InstanceKey[] keys=new InstanceKey[call.getNumberOfParameters()];
    new Object(){
      private void rec(      final int pi){
        if (pi == params.length) {
          f.apply(keys);
        }
 else {
          final int p=params[pi];
          int vn=call.getUse(p);
          PointerKey var=getPointerKeyForLocal(caller,vn);
          InstanceKey[] ik=invariants != null ? invariants[p] : null;
          if (ik != null) {
            if (ik.length > 0) {
              for (int i=0; i < ik.length; i++) {
                system.findOrCreateIndexForInstanceKey(ik[i]);
                keys[p]=ik[i];
                rec(pi + 1);
              }
            }
 else {
              if (!site.isDispatch() || p != 0) {
                keys[p]=null;
                rec(pi + 1);
              }
            }
          }
 else {
            IntSet s=system.findOrCreatePointsToSet(var).getValue();
            if (s != null && !s.isEmpty()) {
              s.foreach(new IntSetAction(){
                public void act(                int x){
                  keys[p]=system.getInstanceKey(x);
                  rec(pi + 1);
                }
              }
);
            }
 else {
              if (!site.isDispatch() || p != 0) {
                keys[p]=null;
                rec(pi + 1);
              }
            }
          }
        }
      }
    }
.rec(0);
  }
}

Fixed version (ground truth):
protected void iterateCrossProduct(final CGNode caller,final SSAAbstractInvokeInstruction call,IntSet parameters,final InstanceKey[][] invariants,final VoidFunction<InstanceKey[]> f){
  final int params[]=IntSetUtil.toArray(parameters);
  final InstanceKey[] keys=new InstanceKey[call.getNumberOfParameters()];
  final CallSiteReference site=call.getCallSite();
  new Object(){
    private void rec(    final int pi){
      if (pi == params.length) {
        f.apply(keys);
      }
 else {
        final int p=params[pi];
        int vn=call.getUse(p);
        PointerKey var=getPointerKeyForLocal(caller,vn);
        InstanceKey[] ik=invariants != null ? invariants[p] : null;
        if (ik != null) {
          if (ik.length > 0) {
            for (int i=0; i < ik.length; i++) {
              system.findOrCreateIndexForInstanceKey(ik[i]);
              keys[p]=ik[i];
              rec(pi + 1);
            }
          }
 else {
            if (!site.isDispatch() || p != 0) {
              keys[p]=null;
              rec(pi + 1);
            }
          }
        }
 else {
          IntSet s=system.findOrCreatePointsToSet(var).getValue();
          if (s != null && !s.isEmpty()) {
            s.foreach(new IntSetAction(){
              public void act(              int x){
                keys[p]=system.getInstanceKey(x);
                rec(pi + 1);
              }
            }
);
          }
 else {
            if (!site.isDispatch() || p != 0) {
              keys[p]=null;
              rec(pi + 1);
            }
          }
        }
      }
    }
  }
.rec(0);
}