Program: 149998
Project: 149998
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 preseved 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 VM_Method 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.contextRegisters.ip);
      Log.write("String_Node_Str");
      Log.writeln(thread.contextRegisters.getIPLocation().loadAddress());
    }
    if (compiledMethodType != VM_CompiledMethod.JNI) {
      codeLocationsPush(code,initialIPLoc);
    }
 else     if (verbosity >= 3) {
      Log.writeln("String_Node_Str");
    }
  }
 else {
    Address returnAddressLoc=VM_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))     codeLocationsPush(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 preseved 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 VM_Method 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.contextRegisters.ip);
      Log.write("String_Node_Str");
      Log.writeln(thread.contextRegisters.getIPLocation().loadAddress());
    }
    if (compiledMethodType != VM_CompiledMethod.JNI)     codeLocationsPush(code,initialIPLoc);
 else     if (verbosity >= 3) {
      Log.writeln("String_Node_Str");
    }
  }
 else {
    Address returnAddressLoc=VM_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))     codeLocationsPush(code,returnAddressLoc);
  }
}