Program: 149886
Project: 149886
Buggy source:
private static DefUseEffect call(OPT_Instruction s){
  if (CF_FIELDS) {
    OPT_MethodOperand methOp=Call.getMethod(s);
    if ((methOp != null) && methOp.isVirtual() && !methOp.hasPreciseTarget()) {
      OPT_Operand calleeThis=Call.getParam(s,0);
      if (calleeThis.isNullConstant()) {
        Trap.mutate(s,TRAP,NullCheck.getClearGuardResult(s),OPT_TrapCodeOperand.NullPtr());
        return DefUseEffect.TRAP_REDUCED;
      }
 else       if (calleeThis.isConstant() || calleeThis.asRegister().isPreciseType()) {
        VM_TypeReference calleeClass=calleeThis.getType();
        if (calleeClass.isResolved()) {
          methOp.refine(calleeClass.peekType());
          return DefUseEffect.UNCHANGED;
        }
      }
    }
    if ((methOp != null) && methOp.hasPreciseTarget() && methOp.getTarget().isPure()) {
      VM_Method method=methOp.getTarget();
      int n=Call.getNumberOfParams(s);
      for (int i=0; i < n; i++) {
        if (!Call.getParam(s,i).isConstant()) {
          return DefUseEffect.UNCHANGED;
        }
      }
      Object thisArg=null;
      VM_TypeReference[] paramTypes=method.getParameterTypes();
      Object[] otherArgs;
      Object result=null;
      if (methOp.isVirtual()) {
        thisArg=boxConstantOperand((OPT_ConstantOperand)Call.getParam(s,0),paramTypes[0]);
        n--;
        otherArgs=new Object[n];
        for (int i=0; i < n; i++) {
          otherArgs[i]=boxConstantOperand((OPT_ConstantOperand)Call.getParam(s,i),paramTypes[i + 1]);
        }
      }
 else {
        otherArgs=new Object[n];
        for (int i=0; i < n; i++) {
          otherArgs[i]=boxConstantOperand((OPT_ConstantOperand)Call.getParam(s,i),paramTypes[i]);
        }
      }
      Throwable t=null;
      try {
        if (VM.runningVM) {
          result=VM_Reflection.invoke(method,thisArg,otherArgs,!methOp.isVirtual());
        }
 else {
          Class<?>[] argTypes=new Class<?>[n];
          for (int i=0; i < n; i++) {
            argTypes[i]=Call.getParam(s,i).getType().resolve().getClassForType();
          }
          Method m=method.getDeclaringClass().getClassForType().getDeclaredMethod(method.getName().toString(),argTypes);
          result=m.invoke(thisArg,otherArgs);
        }
      }
 catch (      Throwable e) {
        t=e;
      }
      if (t != null) {
        return DefUseEffect.UNCHANGED;
      }
      if (method.getReturnType().isVoidType()) {
        Empty.mutate(s,NOP);
        return DefUseEffect.REDUCED;
      }
 else {
        OPT_Operator moveOp=OPT_IRTools.getMoveOp(method.getReturnType());
        Move.mutate(s,moveOp,Call.getClearResult(s),boxConstantObjectAsOperand(result,method.getReturnType()));
        return DefUseEffect.MOVE_FOLDED;
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}

Fixed version (ground truth):
private static DefUseEffect call(OPT_Instruction s){
  if (CF_FIELDS) {
    OPT_MethodOperand methOp=Call.getMethod(s);
    if ((methOp != null) && methOp.isVirtual() && !methOp.hasPreciseTarget()) {
      OPT_Operand calleeThis=Call.getParam(s,0);
      if (calleeThis.isNullConstant()) {
        Trap.mutate(s,TRAP,NullCheck.getClearGuardResult(s),OPT_TrapCodeOperand.NullPtr());
        return DefUseEffect.TRAP_REDUCED;
      }
 else       if (calleeThis.isConstant() || calleeThis.asRegister().isPreciseType()) {
        VM_TypeReference calleeClass=calleeThis.getType();
        if (calleeClass.isResolved()) {
          methOp.refine(calleeClass.peekType());
          return DefUseEffect.UNCHANGED;
        }
      }
    }
    if ((methOp != null) && methOp.hasPreciseTarget() && methOp.getTarget().isPure()) {
      VM_Method method=methOp.getTarget();
      int n=Call.getNumberOfParams(s);
      for (int i=0; i < n; i++) {
        if (!Call.getParam(s,i).isConstant()) {
          return DefUseEffect.UNCHANGED;
        }
      }
      Object thisArg=null;
      VM_TypeReference[] paramTypes=method.getParameterTypes();
      Object[] otherArgs;
      Object result=null;
      if (methOp.isVirtual()) {
        thisArg=boxConstantOperand((OPT_ConstantOperand)Call.getParam(s,0),method.getDeclaringClass().getTypeRef());
        n--;
        otherArgs=new Object[n];
        for (int i=0; i < n; i++) {
          otherArgs[i]=boxConstantOperand((OPT_ConstantOperand)Call.getParam(s,i + 1),paramTypes[i]);
        }
      }
 else {
        otherArgs=new Object[n];
        for (int i=0; i < n; i++) {
          otherArgs[i]=boxConstantOperand((OPT_ConstantOperand)Call.getParam(s,i),paramTypes[i]);
        }
      }
      Throwable t=null;
      try {
        if (VM.runningVM) {
          result=VM_Reflection.invoke(method,thisArg,otherArgs,!methOp.isVirtual());
        }
 else {
          Class<?>[] argTypes=new Class<?>[n];
          for (int i=0; i < n; i++) {
            argTypes[i]=Call.getParam(s,i).getType().resolve().getClassForType();
          }
          Method m=method.getDeclaringClass().getClassForType().getDeclaredMethod(method.getName().toString(),argTypes);
          result=m.invoke(thisArg,otherArgs);
        }
      }
 catch (      Throwable e) {
        t=e;
      }
      if (t != null) {
        return DefUseEffect.UNCHANGED;
      }
      if (method.getReturnType().isVoidType()) {
        Empty.mutate(s,NOP);
        return DefUseEffect.REDUCED;
      }
 else {
        OPT_Operator moveOp=OPT_IRTools.getMoveOp(method.getReturnType());
        Move.mutate(s,moveOp,Call.getClearResult(s),boxConstantObjectAsOperand(result,method.getReturnType()));
        return DefUseEffect.MOVE_FOLDED;
      }
    }
  }
  return DefUseEffect.UNCHANGED;
}