Program: 149765
Project: 149765
Buggy source:
/** 
 * Push the instruction pointer associated with this frame onto the code locations deque.<p> A stack frame represents an execution context, and thus has an instruction pointer associated with it.  In the case of the top frame, the instruction pointer is captured by the IP register, which is preserved in the thread data structure at thread switch time.  In the case of all non-top frames, the next instruction pointer is stored as the return address for the <i>previous</i> frame.<p> The address of the code pointer is pushed onto the code locations deque along with the address of the code object into which it points (both are required since the former is an internal pointer).<p> The code pointers are updated later (after stack scanning) when the code locations deque is processed. The pointer from RVMMethod to the code object is not updated until after stack scanning, so the pointer to the (uncopied) code object is available throughout the stack scanning process, which enables interior pointer offsets to be correctly computed.
 * @param verbosity The level of verbosity to be used whenperforming the scan.
 */
private void pushFrameIP(ObjectReference code,int verbosity){
  if (prevFp.isZero()) {
    if (verbosity >= 2) {
      Log.write("String_Node_Str");
      Log.writeln(thread.getContextRegisters().ip);
      Log.write("String_Node_Str");
      Log.writeln(thread.getContextRegisters().getIPLocation().loadAddress());
    }
    if (compiledMethodType != CompiledMethod.JNI)     processCodeLocation(code,initialIPLoc);
 else     if (verbosity >= 3) {
      Log.writeln("String_Node_Str");
    }
  }
 else {
    Address returnAddressLoc=Magic.getReturnAddressLocation(prevFp);
    Address returnAddress=returnAddressLoc.loadAddress();
    if (verbosity >= 3) {
      Log.write("String_Node_Str");
      Log.write(returnAddress);
      Log.write("String_Node_Str");
      Log.writeln(returnAddressLoc);
    }
    if (!DebugUtil.addrInBootImage(returnAddress))     processCodeLocation(code,returnAddressLoc);
  }
}

Fixed version (ground truth):
/** 
 * Push the instruction pointer associated with this frame onto the code locations deque.<p> A stack frame represents an execution context, and thus has an instruction pointer associated with it.  In the case of the top frame, the instruction pointer is captured by the IP register, which is preserved in the thread data structure at thread switch time.  In the case of all non-top frames, the next instruction pointer is stored as the return address for the <i>previous</i> frame.<p> The address of the code pointer is pushed onto the code locations deque along with the address of the code object into which it points (both are required since the former is an internal pointer).<p> The code pointers are updated later (after stack scanning) when the code locations deque is processed. The pointer from RVMMethod to the code object is not updated until after stack scanning, so the pointer to the (uncopied) code object is available throughout the stack scanning process, which enables interior pointer offsets to be correctly computed.
 * @param verbosity The level of verbosity to be used whenperforming the scan.
 */
private void pushFrameIP(ObjectReference code,int verbosity){
  if (prevFp.isZero()) {
    if (verbosity >= 3) {
      Log.write("String_Node_Str");
      Log.writeln(thread.getContextRegisters().ip);
      Log.write("String_Node_Str");
      Log.writeln(thread.getContextRegisters().getIPLocation().loadAddress());
    }
    if (compiledMethodType != CompiledMethod.JNI)     processCodeLocation(code,initialIPLoc);
 else     if (verbosity >= 4) {
      Log.writeln("String_Node_Str");
    }
  }
 else {
    Address returnAddressLoc=Magic.getReturnAddressLocation(prevFp);
    Address returnAddress=returnAddressLoc.loadAddress();
    if (verbosity >= 4) {
      Log.write("String_Node_Str");
      Log.write(returnAddress);
      Log.write("String_Node_Str");
      Log.writeln(returnAddressLoc);
    }
    if (!DebugUtil.addrInBootImage(returnAddress))     processCodeLocation(code,returnAddressLoc);
  }
}