Program: 186664
Project: 186664
Buggy source:
/** 
 * @param cs the callstring from the invoker to the invoke to inline (if recursive). Used to check DFA results.
 * @param invokee the invoked method to analyze
 * @param inlineData the map to populate with the parameters and the instructions to inline.
 * @return true if inlining is possible
 */
private boolean analyzeInvokee(CallString cs,MethodInfo invokee,InlineData inlineData){
  ValueMapAnalysis values=new ValueMapAnalysis(invokee);
  values.loadParameters();
  InstructionList il=invokee.getCode().getInstructionList(true,false);
  InstructionHandle ih=il.getStart();
  int count=0;
  while (true) {
    Instruction instruction=ih.getInstruction();
    if (instruction instanceof PushInstruction || instruction instanceof NOP) {
      values.transfer(instruction);
      ih=ih.getNext();
      count++;
    }
 else {
      break;
    }
  }
  for (  ValueInfo value : values.getValueTable().getStack()) {
    inlineData.addParam(value);
  }
  inlineData.setInlineStart(count);
  boolean needsNPCheck=helper.needsNullpointerCheck(cs,invokee,false);
  boolean hasNPCheck=false;
  for (int i=0; i < 6; i++) {
    Instruction instruction=ih.getInstruction();
    if (instruction instanceof InvokeInstruction) {
      if (inlineData.getInvokeSite() != null) {
        return false;
      }
      InvokeSite is=invokee.getCode().getInvokeSite(ih);
      inlineData.setInvokeSite(is);
      hasNPCheck|=!is.isInvokeStatic();
    }
 else     if (instruction instanceof FieldInstruction) {
      if (instruction instanceof GETFIELD) {
        hasNPCheck|=values.getValueTable().top(1).isThisReference();
      }
      if (instruction instanceof PUTFIELD) {
        int down=values.getValueTable().top().isContinued() ? 2 : 1;
        hasNPCheck|=values.getValueTable().top(down).isThisReference();
      }
    }
 else     if (instruction instanceof ArithmeticInstruction || instruction instanceof ConversionInstruction || instruction instanceof StackInstruction|| instruction instanceof LDC|| instruction instanceof LDC2_W|| instruction instanceof ARRAYLENGTH|| instruction instanceof NOP) {
    }
 else     if (instruction instanceof ReturnInstruction) {
      if (needsNPCheck && !hasNPCheck) {
        this.requiresNPCheck++;
        if (logger.isTraceEnabled()) {
          logger.trace("String_Node_Str" + invokee + "String_Node_Str");
        }
        return false;
      }
      if (instruction instanceof RETURN) {
        while (values.getValueTable().getStackSize() > 0) {
          Instruction pop;
          if (values.getValueTable().top().isContinued()) {
            pop=new POP2();
          }
 else {
            pop=new POP();
          }
          inlineData.addEpilogue(pop);
          values.transfer(pop);
        }
        return true;
      }
 else {
        Type type=((ReturnInstruction)instruction).getType();
        return values.getValueTable().getStackSize() == type.getSize();
      }
    }
 else {
      unhandledInstructions++;
      if (logger.isTraceEnabled()) {
        logger.trace("String_Node_Str" + invokee + "String_Node_Str"+ instruction.toString(invokee.getClassInfo().getConstantPoolGen().getConstantPool()));
      }
      return false;
    }
    values.transfer(instruction);
    ih=ih.getNext();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param cs the callstring from the invoker to the invoke to inline (if recursive). Used to check DFA results.
 * @param invokee the invoked method to analyze
 * @param inlineData the map to populate with the parameters and the instructions to inline.
 * @return true if inlining is possible
 */
private boolean analyzeInvokee(CallString cs,MethodInfo invokee,InlineData inlineData){
  ValueMapAnalysis values=new ValueMapAnalysis(invokee);
  values.loadParameters();
  InstructionList il=invokee.getCode().getInstructionList(true,false);
  InstructionHandle ih=il.getStart();
  int count=0;
  while (true) {
    Instruction instruction=ih.getInstruction();
    if (instruction instanceof PushInstruction || instruction instanceof NOP) {
      values.transfer(instruction);
      ih=ih.getNext();
      count++;
    }
 else {
      break;
    }
  }
  for (  ValueInfo value : values.getValueTable().getStack()) {
    inlineData.addParam(value);
  }
  inlineData.setInlineStart(count);
  boolean needsNPCheck=helper.needsNullpointerCheck(cs,invokee,false);
  boolean hasNPCheck=false;
  for (int i=0; i < 6; i++) {
    Instruction instruction=ih.getInstruction();
    if (instruction instanceof InvokeInstruction) {
      if (inlineData.getInvokeSite() != null) {
        return false;
      }
      InvokeSite is=invokee.getCode().getInvokeSite(ih);
      inlineData.setInvokeSite(is);
      hasNPCheck|=!is.isInvokeStatic();
    }
 else     if (instruction instanceof FieldInstruction) {
      if (instruction instanceof GETFIELD) {
        hasNPCheck|=values.getValueTable().top(1).isThisReference();
      }
      if (instruction instanceof PUTFIELD) {
        int down=values.getValueTable().top().isContinued() ? 2 : 1;
        hasNPCheck|=values.getValueTable().top(down).isThisReference();
      }
    }
 else     if (instruction instanceof ArithmeticInstruction || instruction instanceof ConversionInstruction || instruction instanceof StackInstruction|| instruction instanceof LDC|| instruction instanceof LDC2_W|| instruction instanceof ARRAYLENGTH|| instruction instanceof CHECKCAST|| instruction instanceof NOP) {
    }
 else     if (instruction instanceof ReturnInstruction) {
      if (needsNPCheck && !hasNPCheck) {
        this.requiresNPCheck++;
        if (logger.isTraceEnabled()) {
          logger.trace("String_Node_Str" + invokee + "String_Node_Str");
        }
        return false;
      }
      if (instruction instanceof RETURN) {
        while (values.getValueTable().getStackSize() > 0) {
          Instruction pop;
          if (values.getValueTable().top().isContinued()) {
            pop=new POP2();
          }
 else {
            pop=new POP();
          }
          inlineData.addEpilogue(pop);
          values.transfer(pop);
        }
        return true;
      }
 else {
        Type type=((ReturnInstruction)instruction).getType();
        return values.getValueTable().getStackSize() == type.getSize();
      }
    }
 else {
      unhandledInstructions++;
      if (logger.isTraceEnabled()) {
        logger.trace("String_Node_Str" + invokee + "String_Node_Str"+ instruction.toString(invokee.getClassInfo().getConstantPoolGen().getConstantPool()));
      }
      return false;
    }
    values.transfer(instruction);
    ih=ih.getNext();
  }
  return false;
}