Program: 85269
Project: 85269
Buggy source:
private void convertInvokeDynamicInsn(InvokeDynamicInsnNode insn){
  StackFrame frame=getFrame(insn);
  Operand[] out=frame.out();
  Operand opr;
  Type returnType;
  if (out == null) {
    SootMethodRef bsmMethodRef=toSootMethodRef(insn.bsm);
    List<Value> bsmMethodArgs=new ArrayList<Value>(insn.bsmArgs.length);
    for (    Object bsmArg : insn.bsmArgs) {
      bsmMethodArgs.add(toSootValue(bsmArg));
    }
    SootClass bclass=Scene.v().getSootClass(SootClass.INVOKEDYNAMIC_DUMMY_CLASS_NAME);
    Type[] types=Util.v().jimpleTypesOfFieldOrMethodDescriptor(insn.desc);
    List<Type> parameterTypes=new ArrayList<Type>(types.length);
    List<Value> methodArgs=new ArrayList<Value>(types.length);
    Operand[] args=new Operand[types.length - 1];
    ValueBox[] boxes=new ValueBox[args.length];
    int nrArgs=args.length;
    while (nrArgs-- != 0) {
      parameterTypes.add(types[nrArgs]);
      args[nrArgs]=popImmediate(types[nrArgs]);
      methodArgs.add(args[nrArgs].stackOrValue());
    }
    if (methodArgs.size() > 1)     Collections.reverse(methodArgs);
    returnType=types[types.length - 1];
    SootMethodRef methodRef=Scene.v().makeMethodRef(bclass,insn.name,parameterTypes,returnType,true);
    DynamicInvokeExpr indy=Jimple.v().newDynamicInvokeExpr(bsmMethodRef,bsmMethodArgs,methodRef,insn.bsm.getTag(),methodArgs);
    for (int i=0; i < args.length - 1; i++) {
      boxes[i]=indy.getArgBox(i);
      args[i].addBox(boxes[i]);
    }
    opr=new Operand(insn,indy);
    frame.boxes(boxes);
    frame.in(args);
    frame.out(opr);
  }
 else {
    opr=out[0];
    InvokeExpr expr=(InvokeExpr)opr.value;
    List<Type> types=expr.getMethodRef().parameterTypes();
    Operand[] oprs;
    int nrArgs=types.size();
    if (expr.getMethodRef().isStatic())     oprs=nrArgs == 0 ? null : new Operand[nrArgs];
 else     oprs=new Operand[nrArgs + 1];
    if (oprs != null) {
      while (nrArgs-- != 0) {
        oprs[nrArgs]=pop(types.get(types.size() - nrArgs - 1));
      }
      if (!expr.getMethodRef().isStatic())       oprs[oprs.length - 1]=pop();
      frame.mergeIn(oprs);
      nrArgs=types.size();
    }
    returnType=expr.getMethodRef().returnType();
  }
  if (AsmUtil.isDWord(returnType))   pushDual(opr);
 else   if (!(returnType instanceof VoidType))   push(opr);
 else   if (!units.containsKey(insn))   setUnit(insn,Jimple.v().newInvokeStmt(opr.value));
  assignReadOps(null);
}

Fixed version (ground truth):
private void convertInvokeDynamicInsn(InvokeDynamicInsnNode insn){
  StackFrame frame=getFrame(insn);
  Operand[] out=frame.out();
  Operand opr;
  Type returnType;
  if (out == null) {
    SootMethodRef bsmMethodRef=toSootMethodRef(insn.bsm);
    List<Value> bsmMethodArgs=new ArrayList<Value>(insn.bsmArgs.length);
    for (    Object bsmArg : insn.bsmArgs) {
      bsmMethodArgs.add(toSootValue(bsmArg));
    }
    SootClass bclass=Scene.v().getSootClass(SootClass.INVOKEDYNAMIC_DUMMY_CLASS_NAME);
    Type[] types=Util.v().jimpleTypesOfFieldOrMethodDescriptor(insn.desc);
    List<Type> parameterTypes=new ArrayList<Type>(types.length);
    List<Value> methodArgs=new ArrayList<Value>(types.length);
    Operand[] args=new Operand[types.length - 1];
    ValueBox[] boxes=new ValueBox[args.length];
    int nrArgs=args.length;
    while (nrArgs-- != 0) {
      parameterTypes.add(types[nrArgs]);
      Operand curOperand=popImmediate(types[nrArgs]);
      args[args.length - nrArgs - 1]=curOperand;
      methodArgs.add(curOperand.stackOrValue());
    }
    returnType=types[types.length - 1];
    SootMethodRef methodRef=Scene.v().makeMethodRef(bclass,insn.name,parameterTypes,returnType,true);
    DynamicInvokeExpr indy=Jimple.v().newDynamicInvokeExpr(bsmMethodRef,bsmMethodArgs,methodRef,insn.bsm.getTag(),methodArgs);
    for (int i=0; i < args.length - 1; i++) {
      boxes[i]=indy.getArgBox(i);
      args[i].addBox(boxes[i]);
    }
    opr=new Operand(insn,indy);
    frame.boxes(boxes);
    frame.in(args);
    frame.out(opr);
  }
 else {
    opr=out[0];
    InvokeExpr expr=(InvokeExpr)opr.value;
    List<Type> types=expr.getMethodRef().parameterTypes();
    Operand[] oprs;
    int nrArgs=types.size();
    if (expr.getMethodRef().isStatic())     oprs=nrArgs == 0 ? null : new Operand[nrArgs];
 else     oprs=new Operand[nrArgs + 1];
    if (oprs != null) {
      while (nrArgs-- != 0) {
        oprs[nrArgs]=pop(types.get(types.size() - nrArgs - 1));
      }
      if (!expr.getMethodRef().isStatic())       oprs[oprs.length - 1]=pop();
      frame.mergeIn(oprs);
      nrArgs=types.size();
    }
    returnType=expr.getMethodRef().returnType();
  }
  if (AsmUtil.isDWord(returnType))   pushDual(opr);
 else   if (!(returnType instanceof VoidType))   push(opr);
 else   if (!units.containsKey(insn))   setUnit(insn,Jimple.v().newInvokeStmt(opr.value));
  assignReadOps(null);
}