Program: 150238
Project: 150238
Buggy source:
public VM_Address getNextReferenceAddress(){
  if (mapId < 0)   mapOffset=maps.getNextJSRRef(mapOffset);
 else   mapOffset=maps.getNextRef(mapOffset,mapId);
  if (VM.TraceStkMaps) {
    VM.sysWrite("String_Node_Str");
    VM.sysWrite(mapOffset);
    VM.sysWrite("String_Node_Str");
    if (mapId < 0)     VM.sysWrite("String_Node_Str");
  }
  if (mapOffset != 0) {
    return (framePtr.add(mapOffset));
  }
 else   if (bridgeParameterMappingRequired) {
    if (VM.TraceStkMaps) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(bridgeTarget);
      VM.sysWrite("String_Node_Str");
    }
    if (!bridgeRegistersLocationUpdated) {
      VM_Address location=framePtr.add(VM_Compiler.getFrameSize(currentMethod));
      location=location.sub((LAST_NONVOLATILE_FPR - FIRST_VOLATILE_FPR + 1) * BYTES_IN_DOUBLE);
      for (int i=LAST_NONVOLATILE_GPR; i >= FIRST_VOLATILE_GPR; --i) {
        location=location.sub(BYTES_IN_ADDRESS);
        registerLocations.set(i,location);
      }
      bridgeRegistersLocationUpdated=true;
    }
    if (bridgeParameterIndex == -1) {
      bridgeParameterIndex+=1;
      bridgeRegisterIndex+=1;
      bridgeRegisterLocation=bridgeRegisterLocation.add(4);
      return bridgeRegisterLocation.sub(4);
    }
    while (true) {
      if (bridgeParameterIndex == bridgeParameterTypes.length || bridgeRegisterIndex > LAST_VOLATILE_GPR) {
        bridgeParameterMappingRequired=false;
        break;
      }
      VM_TypeReference bridgeParameterType=bridgeParameterTypes[bridgeParameterIndex++];
      if (bridgeParameterType.isReferenceType()) {
        bridgeRegisterIndex+=1;
        bridgeRegisterLocation=bridgeRegisterLocation.add(4);
        return bridgeRegisterLocation.sub(4);
      }
 else       if (bridgeParameterType.isLongType()) {
        bridgeRegisterIndex+=2;
        bridgeRegisterLocation=bridgeRegisterLocation.add(8);
      }
 else       if (bridgeParameterType.isDoubleType() || bridgeParameterType.isFloatType()) {
      }
 else {
        bridgeRegisterIndex+=1;
        bridgeRegisterLocation=bridgeRegisterLocation.add(4);
      }
    }
  }
  return VM_Address.zero();
}

Fixed version (ground truth):
public VM_Address getNextReferenceAddress(){
  if (mapId < 0)   mapOffset=maps.getNextJSRRef(mapOffset);
 else   mapOffset=maps.getNextRef(mapOffset,mapId);
  if (VM.TraceStkMaps) {
    VM.sysWrite("String_Node_Str");
    VM.sysWrite(mapOffset);
    VM.sysWrite("String_Node_Str");
    if (mapId < 0)     VM.sysWrite("String_Node_Str");
  }
  if (mapOffset != 0) {
    return (framePtr.add(mapOffset));
  }
 else   if (bridgeParameterMappingRequired) {
    if (VM.TraceStkMaps) {
      VM.sysWrite("String_Node_Str");
      VM.sysWrite(bridgeTarget);
      VM.sysWrite("String_Node_Str");
    }
    if (!bridgeRegistersLocationUpdated) {
      VM_Address location=framePtr.add(VM_Compiler.getFrameSize(currentMethod));
      location=location.sub((LAST_NONVOLATILE_FPR - FIRST_VOLATILE_FPR + 1) * BYTES_IN_DOUBLE);
      for (int i=LAST_NONVOLATILE_GPR; i >= FIRST_VOLATILE_GPR; --i) {
        location=location.sub(BYTES_IN_ADDRESS);
        registerLocations.set(i,location);
      }
      bridgeRegistersLocationUpdated=true;
    }
    if (bridgeParameterIndex == -1) {
      bridgeParameterIndex+=1;
      bridgeRegisterIndex+=1;
      bridgeRegisterLocation=bridgeRegisterLocation.add(BYTES_IN_ADDRESS);
      return bridgeRegisterLocation.sub(BYTES_IN_ADDRESS);
    }
    while (true) {
      if (bridgeParameterIndex == bridgeParameterTypes.length || bridgeRegisterIndex > LAST_VOLATILE_GPR) {
        bridgeParameterMappingRequired=false;
        break;
      }
      VM_TypeReference bridgeParameterType=bridgeParameterTypes[bridgeParameterIndex++];
      if (bridgeParameterType.isReferenceType()) {
        bridgeRegisterIndex+=1;
        bridgeRegisterLocation=bridgeRegisterLocation.add(BYTES_IN_ADDRESS);
        return bridgeRegisterLocation.sub(BYTES_IN_ADDRESS);
      }
 else       if (bridgeParameterType.isLongType()) {
        bridgeRegisterIndex+=VM.BuildFor64Addr ? 1 : 2;
        bridgeRegisterLocation=bridgeRegisterLocation.add(BYTES_IN_LONG);
      }
 else       if (bridgeParameterType.isDoubleType() || bridgeParameterType.isFloatType()) {
      }
 else {
        bridgeRegisterIndex+=1;
        bridgeRegisterLocation=bridgeRegisterLocation.add(BYTES_IN_ADDRESS);
      }
    }
  }
  return VM_Address.zero();
}