Program: 149964
Project: 149964
Buggy source:
/** 
 * This method inspects spill locations between the parameters passed to determine if they look like heap points If the first parameter is 0, it looks from the begining of the frame until new.
 * @param ref1 the last spill found as a reference
 * @param ref2 the next spill found as a reference
 */
final void checkForMissedSpills(Address ref1,Address ref2){
  if (ref1.isZero()) {
    ref1=getFirstSpillLoc();
    if (DEBUG) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(ref1);
      VM.sysWrite("String_Node_Str");
    }
  }
  if (ref2.isZero()) {
    ref2=getLastSpillLoc();
    if (DEBUG) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(ref2);
      VM.sysWrite("String_Node_Str");
    }
  }
  if (ref1.GT(ref2)) {
    Address tmp=ref1;
    ref1=ref2;
    ref2=ref1;
  }
  for (Address i=ref1.plus(BYTES_IN_ADDRESS); i.LT(ref2); i=i.plus(BYTES_IN_ADDRESS)) {
    Address ptr=i.loadAddress();
    if (DEBUG) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(i);
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(ptr);
      VM.sysWrite("String_Node_Str");
    }
    if (MM_Interface.addressInVM(ptr)) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(i);
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(ptr);
      VM.sysWrite("String_Node_Str");
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(framePtr);
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(getFirstSpillLoc());
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(getLastSpillLoc());
      VM.sysWrite("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * This method inspects spill locations between the parameters passed to determine if they look like heap points If the first parameter is 0, it looks from the begining of the frame until new.
 * @param ref1 the last spill found as a reference
 * @param ref2 the next spill found as a reference
 */
final void checkForMissedSpills(Address ref1,Address ref2){
  if (ref1.isZero()) {
    ref1=getFirstSpillLoc();
    if (DEBUG) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(ref1);
      VM.sysWrite("String_Node_Str");
    }
  }
  if (ref2.isZero()) {
    ref2=getLastSpillLoc();
    if (DEBUG) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(ref2);
      VM.sysWrite("String_Node_Str");
    }
  }
  if (ref1.GT(ref2)) {
    Address tmp=ref1;
    ref1=ref2;
    ref2=tmp;
  }
  for (Address i=ref1.plus(BYTES_IN_ADDRESS); i.LT(ref2); i=i.plus(BYTES_IN_ADDRESS)) {
    Address ptr=i.loadAddress();
    if (DEBUG) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(i);
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(ptr);
      VM.sysWrite("String_Node_Str");
    }
    if (MM_Interface.addressInVM(ptr)) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(i);
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(ptr);
      VM.sysWrite("String_Node_Str");
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(framePtr);
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(getFirstSpillLoc());
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(getLastSpillLoc());
      VM.sysWrite("String_Node_Str");
    }
  }
}