nus-yam/ex-repair huggingface dataset:
Program: 149856
Project: 149856
Buggy source:
/** 
 * Return true iff this member reference refers to a method which is declared as part of an abstract class but actually is an interface method, known formally as a "miranda method". This method is necessary to handle the special case where an invokevirtual is defined on an abstract class, where the method invocation points to a method inherited from an interface.
 * @return boolean    true iff this member method reference is a miranda method
 */
public boolean isMiranda(){
  VM_Class declaringClass=(VM_Class)type.peekType();
  if (declaringClass == null) {
    return false;
  }
  if (!declaringClass.isResolved()) {
    declaringClass.resolve();
  }
  for (VM_Class c=declaringClass; c != null; c=c.getSuperClass()) {
    if (c.findDeclaredMethod(name,descriptor) != null) {
      return false;
    }
    for (    VM_Class intf : c.getDeclaredInterfaces()) {
      if (searchInterfaceMethods(intf) != null) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Return true iff this member reference refers to a method which is declared as part of an abstract class but actually is an interface method, known formally as a "miranda method". This method is necessary to handle the special case where an invokevirtual is defined on an abstract class, where the method invocation points to a method inherited from an interface.
 * @return boolean    true iff this member method reference is a miranda method
 */
public boolean isMiranda(){
  VM_Class declaringClass=(VM_Class)type.peekType();
  if (declaringClass == null) {
    return false;
  }
  if (!declaringClass.isResolved()) {
    declaringClass.resolve();
  }
  for (VM_Class c=declaringClass; c != null; c=c.getSuperClass()) {
    if (c.findDeclaredMethod(name,descriptor) != null) {
      return false;
    }
  }
  for (VM_Class c=declaringClass; c != null; c=c.getSuperClass()) {
    for (    VM_Class intf : c.getDeclaredInterfaces()) {
      if (searchInterfaceMethods(intf) != null) {
        return true;
      }
    }
  }
  return false;
}
Program: 149857
Project: 149857
Buggy source:
public Constructor<? super T> getEnclosingConstructor(){
  throw new VM_UnimplementedError();
}

Fixed version (ground truth):
public Constructor<?> getEnclosingConstructor(){
  throw new VM_UnimplementedError();
}
Program: 149858
Project: 149858
Buggy source:
public Class<?> getSuperclass(){
  if (type.isArrayType()) {
    return Object.class;
  }
 else   if (type.isClassType()) {
    VM_Class myClass=type.asClass();
    if (myClass.isInterface())     return null;
    VM_Type supe=myClass.getSuperClass();
    return supe == null ? null : supe.getClassForType();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Class<? super T> getSuperclass(){
  if (type.isArrayType()) {
    return Object.class;
  }
 else   if (type.isClassType()) {
    VM_Class myClass=type.asClass();
    if (myClass.isInterface())     return null;
    VM_Type supe=myClass.getSuperClass();
    return supe == null ? null : (Class<? super T>)supe.getClassForType();
  }
 else {
    return null;
  }
}
Program: 149860
Project: 149860
Buggy source:
/** 
 * Get the compiled method at element
 */
private VM_CompiledMethod getCompiledMethod(int element){
  if ((element > 0) && (element < compiledMethods.length)) {
    int mid=compiledMethods[element];
    if (mid != INVISIBLE_METHOD_ID) {
      return VM_CompiledMethods.getCompiledMethod(element);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get the compiled method at element
 */
private VM_CompiledMethod getCompiledMethod(int element){
  if ((element > 0) && (element < compiledMethods.length)) {
    int mid=compiledMethods[element];
    if (mid != INVISIBLE_METHOD_ID) {
      return VM_CompiledMethods.getCompiledMethod(mid);
    }
  }
  return null;
}
Program: 149861
Project: 149861
Buggy source:
/** 
 * Get class name 
 */
public String getClassName(){
  if (isInvisible || isTrap) {
    return null;
  }
 else {
    return method.getDeclaringClass().toString();
  }
}

Fixed version (ground truth):
/** 
 * Get class name 
 */
public String getClassName(){
  if (isInvisible || isTrap) {
    return "String_Node_Str";
  }
 else {
    return method.getDeclaringClass().toString();
  }
}
Program: 149865
Project: 149865
Buggy source:
/** 
 * Find the first non-VM method at the end of the stack trace
 * @param first the first real method of the stack trace
 * @return compiledMethods.length-1 if no non-VM methods found else the index ofthe method
 */
private int lastRealMethod(int first){
  int max=compiledMethods.length - 1;
  if (VM_Options.stackTraceFull) {
    return max;
  }
 else {
    for (int i=max; i >= first; i--) {
      if (compiledMethods[i] == INVISIBLE_METHOD_ID) {
        if (i - 1 >= 0) {
          return i - 1;
        }
 else {
          return max;
        }
      }
      VM_CompiledMethod compiledMethod=VM_CompiledMethods.getCompiledMethod(compiledMethods[i]);
      if (compiledMethod.getCompilerType() == VM_CompiledMethod.TRAP) {
        return max;
      }
      Class<?> frameClass=compiledMethod.getMethod().getDeclaringClass().getClassForType();
      if ((frameClass != org.jikesrvm.scheduler.VM_MainThread.class) && (frameClass != org.jikesrvm.scheduler.VM_Thread.class) && (frameClass != org.jikesrvm.runtime.VM_Reflection.class)) {
        return i;
      }
    }
    return max;
  }
}

Fixed version (ground truth):
/** 
 * Find the first non-VM method at the end of the stack trace
 * @param first the first real method of the stack trace
 * @return compiledMethods.length-1 if no non-VM methods found else the index ofthe method
 */
private int lastRealMethod(int first){
  int max=compiledMethods.length - 1;
  if (VM_Options.stackTraceFull) {
    return max;
  }
 else {
    for (int i=max; i >= first; i--) {
      if (compiledMethods[i] == INVISIBLE_METHOD_ID) {
        if (i - 1 >= 0) {
          return i - 1;
        }
 else {
          return max;
        }
      }
      VM_CompiledMethod compiledMethod=getCompiledMethod(i);
      if (compiledMethod.getCompilerType() == VM_CompiledMethod.TRAP) {
        return max;
      }
      Class<?> frameClass=compiledMethod.getMethod().getDeclaringClass().getClassForType();
      if ((frameClass != org.jikesrvm.scheduler.VM_MainThread.class) && (frameClass != org.jikesrvm.scheduler.VM_Thread.class) && (frameClass != org.jikesrvm.runtime.VM_Reflection.class)) {
        return i;
      }
    }
    return max;
  }
}
Program: 149866
Project: 149866
Buggy source:
/** 
 * Count number of stack frames including those inlined by the opt compiler
 * @param first the first compiled method to look from
 * @param last the last compiled method to look to
 */
private int countFrames(int first,int last){
  int numElements=0;
  if (!VM.BuildForOptCompiler) {
    numElements=last - first + 1;
  }
 else {
    for (int i=first; i <= last; i++) {
      VM_CompiledMethod compiledMethod=VM_CompiledMethods.getCompiledMethod(compiledMethods[i]);
      if ((compiledMethod == null) || (compiledMethod.getCompilerType() != VM_CompiledMethod.OPT)) {
        numElements++;
      }
 else {
        Offset instructionOffset=Offset.fromIntSignExtend(instructionOffsets[i]);
        VM_OptCompiledMethod optInfo=(VM_OptCompiledMethod)compiledMethod;
        VM_OptMachineCodeMap map=optInfo.getMCMap();
        int iei=map.getInlineEncodingForMCOffset(instructionOffset);
        if (iei < 0) {
          numElements++;
        }
 else {
          int[] inlineEncoding=map.inlineEncoding;
          for (; iei >= 0; iei=VM_OptEncodedCallSiteTree.getParent(iei,inlineEncoding)) {
            numElements++;
          }
        }
      }
    }
  }
  return numElements;
}

Fixed version (ground truth):
/** 
 * Count number of stack frames including those inlined by the opt compiler
 * @param first the first compiled method to look from
 * @param last the last compiled method to look to
 */
private int countFrames(int first,int last){
  int numElements=0;
  if (!VM.BuildForOptCompiler) {
    numElements=last - first + 1;
  }
 else {
    for (int i=first; i <= last; i++) {
      VM_CompiledMethod compiledMethod=getCompiledMethod(i);
      if ((compiledMethod == null) || (compiledMethod.getCompilerType() != VM_CompiledMethod.OPT)) {
        numElements++;
      }
 else {
        Offset instructionOffset=Offset.fromIntSignExtend(instructionOffsets[i]);
        VM_OptCompiledMethod optInfo=(VM_OptCompiledMethod)compiledMethod;
        VM_OptMachineCodeMap map=optInfo.getMCMap();
        int iei=map.getInlineEncodingForMCOffset(instructionOffset);
        if (iei < 0) {
          numElements++;
        }
 else {
          int[] inlineEncoding=map.inlineEncoding;
          for (; iei >= 0; iei=VM_OptEncodedCallSiteTree.getParent(iei,inlineEncoding)) {
            numElements++;
          }
        }
      }
    }
  }
  return numElements;
}
Program: 149867
Project: 149867
Buggy source:
/** 
 * Begin vm execution. Uninterruptible because we are not setup to execute a yieldpoint or stackoverflow check in the prologue this early in booting. The following machine registers are set by "C" bootstrap program before calling this method: JTOC_POINTER        - required for accessing globals FRAME_POINTER       - required for accessing locals THREAD_ID_REGISTER  - required for method prolog (stack overflow check)
 * @exception Exception
 */
@UninterruptibleNoWarn public static void boot(){
  writingBootImage=false;
  runningVM=true;
  runningAsSubsystem=false;
  verboseBoot=VM_BootRecord.the_boot_record.verboseBoot;
  sysWriteLockOffset=VM_Entrypoints.sysWriteLockField.getOffset();
  if (verboseBoot >= 1)   VM.sysWriteln("String_Node_Str");
  if (verboseBoot >= 1)   VM.sysWriteln("String_Node_Str");
  VM_ProcessorLocalState.boot();
  if (verboseBoot >= 1)   VM.sysWriteln("String_Node_Str");
  VM_Thread currentThread=VM_Processor.getCurrentProcessor().activeThread;
  currentThread.stackLimit=VM_Magic.objectAsAddress(currentThread.getStack()).plus(ArchitectureSpecific.VM_StackframeLayoutConstants.STACK_SIZE_GUARD);
  VM_Processor.getCurrentProcessor().activeThreadStackLimit=currentThread.stackLimit;
  finishBooting();
}

Fixed version (ground truth):
/** 
 * Begin vm execution. Uninterruptible because we are not setup to execute a yieldpoint or stackoverflow check in the prologue this early in booting. The following machine registers are set by "C" bootstrap program before calling this method: JTOC_POINTER        - required for accessing globals FRAME_POINTER       - required for accessing locals THREAD_ID_REGISTER  - required for method prolog (stack overflow check)
 * @exception Exception
 */
@UninterruptibleNoWarn public static void boot(){
  writingBootImage=false;
  runningVM=true;
  runningAsSubsystem=false;
  verboseBoot=VM_BootRecord.the_boot_record.verboseBoot;
  sysWriteLockOffset=VM_Entrypoints.sysWriteLockField.getOffset();
  if (verboseBoot >= 1)   VM.sysWriteln("String_Node_Str");
  if (verboseBoot >= 1)   VM.sysWriteln("String_Node_Str");
  VM_SysCall.sysCall.sysRegisterStaticFieldOffsets(VM_Entrypoints.gcStatusField.getOffset().toInt(),VM_Entrypoints.timerTicksField.getOffset().toInt(),VM_Entrypoints.reportedTimerTicksField.getOffset().toInt());
  if (verboseBoot >= 1)   VM.sysWriteln("String_Node_Str");
  VM_ProcessorLocalState.boot();
  if (verboseBoot >= 1)   VM.sysWriteln("String_Node_Str");
  VM_Thread currentThread=VM_Processor.getCurrentProcessor().activeThread;
  currentThread.stackLimit=VM_Magic.objectAsAddress(currentThread.getStack()).plus(ArchitectureSpecific.VM_StackframeLayoutConstants.STACK_SIZE_GUARD);
  VM_Processor.getCurrentProcessor().activeThreadStackLimit=currentThread.stackLimit;
  finishBooting();
}
Program: 149871
Project: 149871
Buggy source:
/** 
 * Hash an address to a chunk (this is simply done via bit shifting)
 * @param address The address to be hashed
 * @return The chunk number that this address hashes into
 */
@Inline private static int hashAddress(Address address){
  if (Space.BYTES_IN_ADDRESS == 8)   return address.diff(Space.AVAILABLE_START).toWord().rshl(Space.LOG_BYTES_IN_CHUNK).toInt();
 else   return address.toWord().rshl(Space.LOG_BYTES_IN_CHUNK).toInt();
}

Fixed version (ground truth):
/** 
 * Hash an address to a chunk (this is simply done via bit shifting)
 * @param address The address to be hashed
 * @return The chunk number that this address hashes into
 */
@Inline private static int hashAddress(Address address){
  if (Space.BYTES_IN_ADDRESS == 8) {
    if (address.LT(Space.HEAP_START) || address.GE(Space.HEAP_END))     return 0;
 else     return address.diff(MAP_BASE_ADDRESS).toWord().rshl(Space.LOG_BYTES_IN_CHUNK).toInt();
  }
 else   return address.toWord().rshl(Space.LOG_BYTES_IN_CHUNK).toInt();
}
Program: 149872
Project: 149872
Buggy source:
@Inline private static Address reverseHashChunk(int chunk){
  if (Space.BYTES_IN_ADDRESS == 8)   return Space.AVAILABLE_START.plus(Word.fromIntZeroExtend(chunk).lsh(Space.LOG_BYTES_IN_CHUNK).toExtent());
 else   return Word.fromIntZeroExtend(chunk).lsh(Space.LOG_BYTES_IN_CHUNK).toAddress();
}

Fixed version (ground truth):
@Inline private static Address reverseHashChunk(int chunk){
  if (Space.BYTES_IN_ADDRESS == 8) {
    if (chunk == 0)     return Address.zero();
 else     return MAP_BASE_ADDRESS.plus(Word.fromIntZeroExtend(chunk).lsh(Space.LOG_BYTES_IN_CHUNK).toExtent());
  }
 else   return Word.fromIntZeroExtend(chunk).lsh(Space.LOG_BYTES_IN_CHUNK).toAddress();
}
Program: 149874
Project: 149874
Buggy source:
/** 
 * Resize the free list associated with this resource.  This method is called to re-set the free list once the global free list (which it shares) is finalized.  There's a circular dependency, so we need an explicit call-back to reset the free list size.
 */
@Interruptible public void resizeFreeList(){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!contiguous && !Plan.isInitialized());
  freeList.resizeFreeList();
}

Fixed version (ground truth):
/** 
 * Resize the free list associated with this resource and nail down its start address. This method is called to re-set the free list once the global free list (which it shares) is finalized and the base address is finalized.  There's a circular dependency, so we need an explicit call-back to reset the free list size and start
 * @param startAddress The final start address for the discontiguous space.
 */
@Interruptible public void resizeFreeList(Address startAddress){
  if (VM.VERIFY_ASSERTIONS)   VM.assertions._assert(!contiguous && !Plan.isInitialized());
  start=startAddress;
  freeList.resizeFreeList();
}
Program: 149875
Project: 149875
Buggy source:
/** 
 * Finalize the space map, establishing which virtual memory is nailed down, and then placing the rest into a map to be used by discontiguous spaces.
 */
@Interruptible public static void finalizeStaticSpaceMap(){
  int start=hashAddress(Space.getDiscontigStart());
  int end=hashAddress(Space.getDiscontigEnd());
  int pages=(end - start) * Space.PAGES_IN_CHUNK;
  globalPageMap.resizeFreeList(pages,pages);
  for (int pr=0; pr < sharedDiscontigFLCount; pr++)   sharedFLMap[pr].resizeFreeList();
  regionMap.alloc(start);
  for (int chunk=start; chunk < end; chunk++)   regionMap.alloc(1);
  regionMap.alloc(Space.MAX_CHUNKS - end);
  int firstPage=0;
  for (int chunk=start; chunk < end; chunk++) {
    if (VM.VERIFY_ASSERTIONS)     VM.assertions._assert(spaceMap[chunk] == null);
    totalAvailableDiscontiguousChunks++;
    regionMap.free(chunk);
    globalPageMap.setUncoalescable(firstPage);
    int tmp=globalPageMap.alloc(Space.PAGES_IN_CHUNK);
    if (VM.VERIFY_ASSERTIONS)     VM.assertions._assert(tmp == firstPage);
    firstPage+=Space.PAGES_IN_CHUNK;
  }
}

Fixed version (ground truth):
/** 
 * Finalize the space map, establishing which virtual memory is nailed down, and then placing the rest into a map to be used by discontiguous spaces.
 */
@Interruptible public static void finalizeStaticSpaceMap(){
  Address startAddress=Space.getDiscontigStart();
  int start=hashAddress(startAddress);
  int end=hashAddress(Space.getDiscontigEnd());
  int pages=(end - start) * Space.PAGES_IN_CHUNK + 1;
  globalPageMap.resizeFreeList(pages,pages);
  for (int pr=0; pr < sharedDiscontigFLCount; pr++)   sharedFLMap[pr].resizeFreeList(startAddress);
  regionMap.alloc(start);
  for (int chunk=start; chunk < end; chunk++)   regionMap.alloc(1);
  regionMap.alloc(Space.MAX_CHUNKS - end);
  int firstPage=0;
  for (int chunk=start; chunk < end; chunk++) {
    if (VM.VERIFY_ASSERTIONS)     VM.assertions._assert(spaceMap[chunk] == null);
    totalAvailableDiscontiguousChunks++;
    regionMap.free(chunk);
    globalPageMap.setUncoalescable(firstPage);
    int tmp=globalPageMap.alloc(Space.PAGES_IN_CHUNK);
    if (VM.VERIFY_ASSERTIONS)     VM.assertions._assert(tmp == firstPage);
    firstPage+=Space.PAGES_IN_CHUNK;
  }
}
Program: 149876
Project: 149876
Buggy source:
/** 
 * Finalize the space map, establishing which virtual memory is nailed down, and then placing the rest into a map to be used by discontiguous spaces.
 */
public static void finalizeStaticSpaceMap(){
  int start=hashAddress(Space.AVAILABLE_START);
  int end=hashAddress(Space.AVAILABLE_END);
  regionMap.alloc(start);
  for (int chunk=start; chunk < end; chunk++)   regionMap.alloc(1);
  regionMap.alloc(Space.MAX_CHUNKS - end);
  int firstPage=0;
  for (int chunk=start; chunk < end; chunk++) {
    if (spaceMap[chunk] == null) {
      totalAvailableDiscontiguousChunks++;
      regionMap.free(chunk);
      globalPageMap.setUncoalescable(firstPage);
      int tmp=globalPageMap.alloc(Space.PAGES_IN_CHUNK);
      if (VM.VERIFY_ASSERTIONS)       VM.assertions._assert(tmp == firstPage);
      firstPage+=Space.PAGES_IN_CHUNK;
    }
  }
}

Fixed version (ground truth):
/** 
 * Finalize the space map, establishing which virtual memory is nailed down, and then placing the rest into a map to be used by discontiguous spaces.
 */
public static void finalizeStaticSpaceMap(){
  int start=hashAddress(Space.AVAILABLE_START);
  int end=hashAddress(Space.AVAILABLE_END);
  regionMap.alloc(start);
  for (int chunk=start; chunk < end; chunk++)   regionMap.alloc(1);
  regionMap.alloc(Space.MAX_CHUNKS - end);
  int firstPage=0;
  for (int chunk=start; chunk < end; chunk++) {
    if (spaceMap[chunk] == null) {
      totalAvailableDiscontiguousChunks++;
      regionMap.free(chunk);
    }
    globalPageMap.setUncoalescable(firstPage);
    int tmp=globalPageMap.alloc(Space.PAGES_IN_CHUNK);
    if (VM.VERIFY_ASSERTIONS)     VM.assertions._assert(tmp == firstPage);
    firstPage+=Space.PAGES_IN_CHUNK;
  }
}
Program: 149877
Project: 149877
Buggy source:
/** 
 * Suspend thread if a suspend is pending. Called by processor dispatch loop.
 * @return whether the thread had a suspend pending
 */
final boolean suspendIfPending(){
  if (suspendPending == 1) {
    if (VM_Synchronization.tryCompareAndSwap(this,suspendPendingOffset,1,0)) {
      return true;
    }
 else {
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Suspend thread if a suspend is pending. Called by processor dispatch loop. Thread will be dequeued and not run if this returns true.
 * @return whether the thread had a suspend pending
 */
final boolean suspendIfPending(){
  if (suspendPending == 1) {
    if (VM_Synchronization.tryCompareAndSwap(this,suspendPendingOffset,1,0)) {
      return true;
    }
 else {
    }
  }
  return false;
}
Program: 149878
Project: 149878
Buggy source:
/** 
 * Thread model dependent part of thread resumption
 */
@Override protected final void resumeInternal(){
  VM_Synchronization.tryCompareAndSwap(this,suspendPendingOffset,1,0);
  VM_GreenProcessor.getCurrentProcessor().scheduleThread(this);
}

Fixed version (ground truth):
/** 
 * Thread model dependent part of thread resumption
 */
@Override protected final void resumeInternal(){
  if (VM_Synchronization.tryCompareAndSwap(this,suspendPendingOffset,1,0)) {
  }
 else {
    VM_GreenProcessor.getCurrentProcessor().scheduleThread(this);
  }
}
Program: 149879
Project: 149879
Buggy source:
/** 
 * Thread model dependent part of thread suspension
 */
@Override protected final void suspendInternal(){
  VM_Synchronization.tryCompareAndSwap(this,suspendPendingOffset,0,1);
  if (this == VM_GreenScheduler.getCurrentThread())   yield();
}

Fixed version (ground truth):
/** 
 * Thread model dependent part of thread suspension
 */
@Override protected final void suspendInternal(){
  if (VM_Synchronization.tryCompareAndSwap(this,suspendPendingOffset,0,1)) {
  }
 else {
  }
  if (this == VM_GreenScheduler.getCurrentThread())   yield();
}
Program: 149880
Project: 149880
Buggy source:
/** 
 * Add a thread to tail of queue. 
 */
@Override @UninterruptibleNoWarn public void enqueue(VM_GreenThread t){
  if (VM.VerifyAssertions && t.getNext() != null) {
    VM.sysWrite("String_Node_Str");
    VM.sysWriteln(VM_Magic.getObjectType(t).getDescriptor());
    VM._assert(false);
  }
  if (VM.VerifyAssertions)   VM._assert(t.isQueueable());
  if (head == null) {
    head=t;
  }
 else {
    tail.setNext(t);
  }
  tail=t;
}

Fixed version (ground truth):
/** 
 * Add a thread to tail of queue. 
 */
@Override @UninterruptibleNoWarn public void enqueue(VM_GreenThread t){
  if (VM.VerifyAssertions && t.getNext() != null) {
    VM.sysWrite("String_Node_Str");
    VM.sysWrite(VM_Magic.getObjectType(t).getDescriptor());
    VM.sysWrite("String_Node_Str",t.getIndex());
    VM.sysWrite("String_Node_Str",t.toString());
    VM.sysWrite("String_Node_Str",t.getJavaLangThread().toString());
    t=t.getNext();
    VM.sysWrite("String_Node_Str");
    VM.sysWrite(VM_Magic.getObjectType(t).getDescriptor());
    VM.sysWrite("String_Node_Str",t.getIndex());
    VM.sysWrite("String_Node_Str",t.toString());
    VM.sysWrite("String_Node_Str",t.getJavaLangThread().toString());
    VM_Scheduler.dumpVirtualMachine();
    VM.sysFail("String_Node_Str");
  }
  if (VM.VerifyAssertions)   VM._assert(t.isQueueable());
  if (head == null) {
    head=t;
  }
 else {
    tail.setNext(t);
  }
  tail=t;
}
Program: 149881
Project: 149881
Buggy source:
/** 
 * Get a thread that has become ready to run.
 * @return the thread, or null if no threads from this queue are ready
 */
@Override public VM_GreenThread dequeue(){
  VM_GreenThread prev=null;
  VM_GreenThread thread=head;
  if (VM.VerifyAssertions)   VM._assert(ready >= 0);
  while (thread != null) {
    if (thread.waitData.isFinished()) {
      break;
    }
    prev=thread;
    thread=thread.getNext();
  }
  if (thread != null) {
    if (prev == null) {
      head=thread.getNext();
    }
 else {
      prev.setNext(thread.getNext());
    }
    if (tail == thread) {
      tail=prev;
    }
    prev=null;
    --length;
    --ready;
  }
 else {
    if (VM.VerifyAssertions)     VM._assert(ready == 0);
  }
  return thread;
}

Fixed version (ground truth):
/** 
 * Get a thread that has become ready to run.
 * @return the thread, or null if no threads from this queue are ready
 */
@Override public VM_GreenThread dequeue(){
  VM_GreenThread prev=null;
  VM_GreenThread thread=head;
  if (VM.VerifyAssertions)   VM._assert(ready >= 0);
  while (thread != null) {
    if (thread.waitData.isFinished()) {
      break;
    }
    prev=thread;
    thread=thread.getNext();
  }
  if (thread != null) {
    if (prev == null) {
      head=thread.getNext();
    }
 else {
      prev.setNext(thread.getNext());
    }
    if (tail == thread) {
      tail=prev;
    }
    thread.setNext(null);
    --length;
    --ready;
  }
 else {
    if (VM.VerifyAssertions)     VM._assert(ready == 0);
  }
  return thread;
}
Program: 149882
Project: 149882
Buggy source:
/** 
 * Dump state for debugging.
 */
@Interruptible void dump(String prefix){
  VM.sysWrite(prefix);
  for (VM_GreenThread t=head; t != null; t=t.getNext()) {
    VM.sysWrite(t.getIndex());
    dumpWaitDescription((VM_GreenThread)t);
  }
  VM.sysWrite("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Dump state for debugging.
 */
@Interruptible void dump(String prefix){
  VM.sysWrite(prefix);
  for (VM_GreenThread t=head; t != null; t=t.getNext()) {
    VM.sysWrite(t.getIndex());
    dumpWaitDescription(t);
  }
  VM.sysWrite("String_Node_Str");
}
Program: 149884
Project: 149884
Buggy source:
private static long getLongBitsFrom(int vtype,int valueHigh,int valueLow,byte[] stack,Offset fpOffset,OSR_TempRegisters registers){
  if (vtype == LCONST || vtype == ACONST) {
    return ((((long)valueHigh) << 32) | (((long)valueLow) & 0x0FFFFFFFF));
  }
 else   if (VM.BuildFor32Addr) {
    if (vtype == PHYREG) {
      return ((((long)registers.gprs.get(valueHigh).toInt()) << 32) | (((long)registers.gprs.get(valueLow).toInt()) & 0x0FFFFFFFFL));
    }
 else     if (vtype == SPILL) {
      long lvalue=((long)VM_Magic.getIntAtOffset(stack,fpOffset.minus(valueHigh))) << 32;
      return (lvalue | (((long)VM_Magic.getIntAtOffset(stack,fpOffset.minus(valueLow))) & 0x0FFFFFFFFL));
    }
  }
 else   if (VM.BuildFor64Addr) {
    if (vtype == PHYREG) {
      return registers.gprs.get(valueLow).toLong();
    }
 else     if (vtype == SPILL) {
      return VM_Magic.getLongAtOffset(stack,fpOffset.minus(valueLow));
    }
  }
  if (VM.VerifyAssertions)   VM._assert(NOT_REACHED);
  return -1L;
}

Fixed version (ground truth):
private static long getLongBitsFrom(int vtypeHigh,int valueHigh,int vtypeLow,int valueLow,byte[] stack,Offset fpOffset,OSR_TempRegisters registers){
  if (vtypeLow == LCONST || vtypeLow == ACONST) {
    if (VM.VerifyAssertions)     VM._assert(vtypeHigh == vtypeLow);
    return ((((long)valueHigh) << 32) | (((long)valueLow) & 0x0FFFFFFFFL));
  }
 else   if (VM.BuildFor32Addr) {
    if (VM.VerifyAssertions)     VM._assert(vtypeHigh == PHYREG || vtypeHigh == SPILL);
    if (VM.VerifyAssertions)     VM._assert(vtypeLow == PHYREG || vtypeLow == SPILL);
    long lowPart, highPart;
    if (vtypeLow == PHYREG) {
      lowPart=((long)registers.gprs.get(valueLow).toInt()) & 0x0FFFFFFFFL;
    }
 else {
      lowPart=((long)VM_Magic.getIntAtOffset(stack,fpOffset.minus(valueLow))) & 0x0FFFFFFFFL;
    }
    if (vtypeHigh == PHYREG) {
      highPart=((long)registers.gprs.get(valueHigh).toInt());
    }
 else {
      highPart=((long)VM_Magic.getIntAtOffset(stack,fpOffset.minus(valueHigh)));
    }
    return (highPart << 32) | lowPart;
  }
 else   if (VM.BuildFor64Addr) {
    if (vtypeLow == PHYREG) {
      return registers.gprs.get(valueLow).toLong();
    }
 else     if (vtypeLow == SPILL) {
      return VM_Magic.getLongAtOffset(stack,fpOffset.minus(valueLow));
    }
  }
  if (VM.VerifyAssertions)   VM._assert(NOT_REACHED);
  return -1L;
}
Program: 149887
Project: 149887
Buggy source:
/** 
 * Thread model dependant sleep
 * @param millis
 * @param ns
 */
@Interruptible @Override protected void sleepInternal(long millis,int ns) throws InterruptedException {
  wakeupNanoTime=VM_Time.nanoTime() + (millis * (long)1e6);
  VM_ThreadProxy proxy=new VM_ThreadProxy(this,wakeupNanoTime);
  if (sleepImpl(proxy)) {
    throw new InterruptedException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Thread model dependant sleep
 * @param millis
 * @param ns
 */
@Interruptible @Override protected void sleepInternal(long millis,int ns) throws InterruptedException {
  wakeupNanoTime=VM_Time.nanoTime() + (millis * (long)1e6) + ns;
  VM_ThreadProxy proxy=new VM_ThreadProxy(this,wakeupNanoTime);
  if (sleepImpl(proxy)) {
    throw new InterruptedException("String_Node_Str");
  }
}
Program: 149888
Project: 149888
Buggy source:
/** 
 * Add a reference at the end of the table
 * @param ref The reference to add
 */
private void addReference(Reference<?> ref){
  setReference(maxIndex++,ObjectReference.fromObject(ref));
}

Fixed version (ground truth):
/** 
 * Add a reference at the end of the table
 * @param ref The reference to add
 */
private void addReference(Reference<?> ref,ObjectReference referent){
  ObjectReference reference=ObjectReference.fromObject(ref);
  setReferent(reference,referent);
  setReference(maxIndex++,reference);
}
Program: 149889
Project: 149889
Buggy source:
/** 
 * Grow the reference table by GROWTH_FACTOR Logically Uninterruptible because it can GC when it allocates, but the rest of the code can't tolerate GC
 */
@UninterruptibleNoWarn private AddressArray growReferenceTable(){
  int newLength=STRESS ? references.length() + 1 : (int)(references.length() * GROWTH_FACTOR);
  if (TRACE)   VM.sysWriteln("String_Node_Str",semanticsStr,"String_Node_Str",newLength);
  AddressArray newReferences=AddressArray.create(newLength);
  for (int i=0; i < references.length(); i++)   newReferences.set(i,references.get(i));
  return newReferences;
}

Fixed version (ground truth):
/** 
 * Grow the reference table by GROWTH_FACTOR. <p>Logically Uninterruptible because it can GC when it allocates, but the rest of the code can't tolerate GC. <p>This method is called without the reference processor lock held, but with the flag <code>growingTable</code> set.
 */
@UninterruptibleNoWarn private AddressArray growReferenceTable(){
  int newLength=STRESS ? references.length() + 1 : (int)(references.length() * GROWTH_FACTOR);
  if (TRACE)   VM.sysWriteln("String_Node_Str",semanticsStr,"String_Node_Str",newLength);
  AddressArray newReferences=AddressArray.create(newLength);
  for (int i=0; i < references.length(); i++)   newReferences.set(i,references.get(i));
  return newReferences;
}
Program: 149890
Project: 149890
Buggy source:
/** 
 * Add a reference to the list of soft references.
 * @param ref the SoftReference to add
 */
@Interruptible public static void addSoftCandidate(SoftReference<?> ref){
  softReferenceProcessor.addCandidate(ref);
}

Fixed version (ground truth):
/** 
 * Add a reference to the list of soft references.
 * @param ref the SoftReference to add
 */
@Interruptible public static void addSoftCandidate(ObjectReference referent,SoftReference<?> ref){
  softReferenceProcessor.addCandidate(referent,ref);
}
Program: 149891
Project: 149891
Buggy source:
/** 
 * Add a reference to the list of phantom references.
 * @param ref the PhantomReference to add
 */
@Interruptible public static void addPhantomCandidate(PhantomReference<?> ref){
  phantomReferenceProcessor.addCandidate(ref);
}

Fixed version (ground truth):
/** 
 * Add a reference to the list of phantom references.
 * @param ref the PhantomReference to add
 */
@Interruptible public static void addPhantomCandidate(ObjectReference referent,PhantomReference<?> ref){
  phantomReferenceProcessor.addCandidate(referent,ref);
}
Program: 149892
Project: 149892
Buggy source:
/** 
 * Add a reference to the list of weak references.
 * @param ref the WeakReference to add
 */
@Interruptible public static void addWeakCandidate(WeakReference<?> ref){
  weakReferenceProcessor.addCandidate(ref);
}

Fixed version (ground truth):
/** 
 * Add a reference to the list of weak references.
 * @param ref the WeakReference to add
 */
@Interruptible public static void addWeakCandidate(ObjectReference referent,WeakReference<?> ref){
  weakReferenceProcessor.addCandidate(referent,ref);
}
Program: 149893
Project: 149893
Buggy source:
/** 
 * Add a reference to the list of references. (SJF: This method must NOT be inlined into an inlined allocation sequence, since it contains a lock!)
 * @param ref the reference to add
 */
@NoInline private void addCandidate(Reference<?> ref){
  if (TRACE) {
    ObjectReference referenceAsAddress=ObjectReference.fromObject(ref);
    ObjectReference referent=getReferent(referenceAsAddress);
    VM.sysWrite("String_Node_Str",referenceAsAddress);
    VM.sysWriteln("String_Node_Str",referent);
  }
  lock.acquire();
  addReference(ref);
  while (maxIndex >= references.length()) {
    if (growingTable) {
      lock.release();
      VM_Scheduler.yield();
      lock.acquire();
    }
 else {
      growingTable=true;
      lock.release();
      AddressArray newTable=growReferenceTable();
      lock.acquire();
      references=newTable;
      growingTable=false;
    }
  }
  lock.release();
}

Fixed version (ground truth):
/** 
 * Add a reference to the list of references.  This method is responsible for installing the  address of the referent into the Reference object so that the referent is traced at all yield points before the Reference is correctly installed in the reference table. (SJF: This method must NOT be inlined into an inlined allocation sequence, since it contains a lock!)
 * @param referent The referent of the reference
 * @param ref The reference to add
 */
@NoInline private void addCandidate(ObjectReference referent,Reference<?> ref){
  if (TRACE) {
    ObjectReference referenceAsAddress=ObjectReference.fromObject(ref);
    VM.sysWrite("String_Node_Str",referenceAsAddress);
    VM.sysWriteln("String_Node_Str",referent);
  }
  lock.acquire();
  while (growingTable || maxIndex >= references.length()) {
    if (growingTable) {
      lock.release();
      VM_Scheduler.yield();
      lock.acquire();
    }
 else {
      growingTable=true;
      lock.release();
      AddressArray newTable=growReferenceTable();
      lock.acquire();
      references=newTable;
      growingTable=false;
    }
  }
  addReference(ref,referent);
  lock.release();
}
Program: 149894
Project: 149894
Buggy source:
public PhantomReference(T referent,ReferenceQueue<T> q){
  super(referent,q);
  MM_Interface.addPhantomReference(this);
}

Fixed version (ground truth):
public PhantomReference(T referent,ReferenceQueue<T> q){
  super(referent,q);
  MM_Interface.addPhantomReference(referent,this);
}
Program: 149895
Project: 149895
Buggy source:
@LogicallyUninterruptible @Uninterruptible public boolean enqueue(){
  if (nextOnQueue == null && queue != null) {
    wasEnqueued=true;
    queue.enqueue(this);
    queue=null;
    return true;
  }
  return false;
}

Fixed version (ground truth):
@LogicallyUninterruptible @Uninterruptible public boolean enqueue(){
  if (nextOnQueue == null && queue != null) {
    queue.enqueue(this);
    queue=null;
    return true;
  }
  return false;
}
Program: 149896
Project: 149896
Buggy source:
Reference(T ref,ReferenceQueue<T> q){
  if (q == null)   throw new NullPointerException();
  referent=VM_Magic.objectAsAddress(ref);
  queue=q;
}

Fixed version (ground truth):
Reference(T ref,ReferenceQueue<T> q){
  if (q == null)   throw new NullPointerException();
  queue=q;
}
Program: 149897
Project: 149897
Buggy source:
public SoftReference(T referent,ReferenceQueue<T> q){
  super(referent,q);
  MM_Interface.addSoftReference(this);
}

Fixed version (ground truth):
public SoftReference(T referent,ReferenceQueue<T> q){
  super(referent,q);
  MM_Interface.addSoftReference(referent,this);
}
Program: 149898
Project: 149898
Buggy source:
public WeakReference(T referent,ReferenceQueue<T> q){
  super(referent,q);
  MM_Interface.addWeakReference(this);
}

Fixed version (ground truth):
public WeakReference(T referent,ReferenceQueue<T> q){
  super(referent,q);
  MM_Interface.addWeakReference(referent,this);
}
Program: 149899
Project: 149899
Buggy source:
/** 
 * Add a phantom reference to the list of phantom references.
 * @param obj the phantom reference to be added to the list
 */
@Interruptible public static void addPhantomReference(PhantomReference<?> obj){
  ReferenceProcessor.addPhantomCandidate(obj);
}

Fixed version (ground truth):
/** 
 * Add a phantom reference to the list of phantom references.
 * @param obj the phantom reference to be added to the list
 */
@Interruptible public static void addPhantomReference(Object referent,PhantomReference<?> obj){
  ReferenceProcessor.addPhantomCandidate(ObjectReference.fromObject(referent),obj);
}
Program: 149900
Project: 149900
Buggy source:
/** 
 * Add a weak reference to the list of weak references.
 * @param obj the weak reference to be added to the list
 */
@Interruptible public static void addWeakReference(WeakReference<?> obj){
  ReferenceProcessor.addWeakCandidate(obj);
}

Fixed version (ground truth):
/** 
 * Add a weak reference to the list of weak references.
 * @param obj the weak reference to be added to the list
 */
@Interruptible public static void addWeakReference(Object referent,WeakReference<?> obj){
  ReferenceProcessor.addWeakCandidate(ObjectReference.fromObject(referent),obj);
}
Program: 149901
Project: 149901
Buggy source:
/** 
 * Add a soft reference to the list of soft references.
 * @param obj the soft reference to be added to the list
 */
@Interruptible public static void addSoftReference(SoftReference<?> obj){
  ReferenceProcessor.addSoftCandidate(obj);
}

Fixed version (ground truth):
/** 
 * Add a soft reference to the list of soft references.
 * @param obj the soft reference to be added to the list
 */
@Interruptible public static void addSoftReference(Object referent,SoftReference<?> obj){
  ReferenceProcessor.addSoftCandidate(ObjectReference.fromObject(referent),obj);
}
Program: 149902
Project: 149902
Buggy source:
public static void main(String[] args) throws Throwable {
  boolean base=true;
  if (args.length == 0)   System.out.println("String_Node_Str");
  if (args[0].compareTo("String_Node_Str") == 0 || args[0].compareTo("String_Node_Str") == 0) {
    base=false;
    timeLimit=600;
  }
  allocSize=base ? 500 : 3000;
  runTest();
  System.exit(0);
}

Fixed version (ground truth):
public static void main(String[] args) throws Throwable {
  boolean base=true;
  if (args.length == 0) {
    System.out.println("String_Node_Str");
  }
  if (args[0].compareTo("String_Node_Str") == 0 || args[0].compareTo("String_Node_Str") == 0) {
    base=false;
    timeLimit=600;
  }
  allocSize=base ? 500 : 3000;
  runTest();
  System.exit(0);
}
Program: 149904
Project: 149904
Buggy source:
/** 
 * Update the reference table
 * @param i The table index
 * @param ref The reference to insert
 */
private void setReference(int i,ObjectReference ref){
  if (TRACE_DETAIL) {
    VM.sysWrite("String_Node_Str",i);
    VM.sysWriteln("String_Node_Str",ref);
  }
  references.set(i,ref.toAddress());
}

Fixed version (ground truth):
/** 
 * Update the reference table
 * @param i The table index
 * @param ref The reference to insert
 */
private void setReference(int i,ObjectReference ref){
  references.set(i,ref.toAddress());
}
Program: 149905
Project: 149905
Buggy source:
/** 
 * Add a reference to the list of references. (SJF: This method must NOT be inlined into an inlined allocation sequence, since it contains a lock!)
 * @param ref the reference to add
 */
@NoInline private void addCandidate(Reference<?> ref){
  if (TRACE) {
    ObjectReference referenceAsAddress=ObjectReference.fromObject(ref);
    ObjectReference referent=getReferent(referenceAsAddress);
    VM.sysWrite("String_Node_Str",referenceAsAddress);
    VM.sysWriteln("String_Node_Str",referent);
  }
  lock.acquire();
  while (maxIndex >= references.length()) {
    if (growingTable) {
      lock.release();
      VM_Scheduler.yield();
      lock.acquire();
    }
 else {
      growingTable=true;
      lock.release();
      AddressArray newTable=growReferenceTable();
      lock.acquire();
      references=newTable;
      growingTable=false;
    }
  }
  if (TRACE) {
    VM.sysWriteln("String_Node_Str",maxIndex);
  }
  addReference(ref);
  lock.release();
}

Fixed version (ground truth):
/** 
 * Add a reference to the list of references. (SJF: This method must NOT be inlined into an inlined allocation sequence, since it contains a lock!)
 * @param ref the reference to add
 */
@NoInline private void addCandidate(Reference<?> ref){
  if (TRACE) {
    ObjectReference referenceAsAddress=ObjectReference.fromObject(ref);
    ObjectReference referent=getReferent(referenceAsAddress);
    VM.sysWrite("String_Node_Str",referenceAsAddress);
    VM.sysWriteln("String_Node_Str",referent);
  }
  lock.acquire();
  addReference(ref);
  while (maxIndex >= references.length()) {
    if (growingTable) {
      lock.release();
      VM_Scheduler.yield();
      lock.acquire();
    }
 else {
      growingTable=true;
      lock.release();
      AddressArray newTable=growReferenceTable();
      lock.acquire();
      references=newTable;
      growingTable=false;
    }
  }
  lock.release();
}
Program: 149906
Project: 149906
Buggy source:
public static void main(String[] args) throws Throwable {
  boolean base=true;
  if (args.length == 0)   System.out.println("String_Node_Str");
  if (args[0].compareTo("String_Node_Str") == 0 || args[0].compareTo("String_Node_Str") == 0)   base=false;
  liveSize=base ? 30 : 100;
  exclude=base ? 0 : 2;
  sampleCount=-exclude;
  if (liveSize < 0)   System.out.println("String_Node_Str");
  runTest();
  System.exit(0);
}

Fixed version (ground truth):
public static void main(String[] args) throws Throwable {
  boolean base=true;
  if (args.length == 0) {
    System.out.println("String_Node_Str");
  }
 else   if (args[0].compareTo("String_Node_Str") == 0 || args[0].compareTo("String_Node_Str") == 0) {
    base=false;
  }
  liveSize=base ? 30 : 100;
  exclude=base ? 0 : 2;
  sampleCount=-exclude;
  if (liveSize < 0)   System.out.println("String_Node_Str");
  runTest();
  System.exit(0);
}
Program: 149907
Project: 149907
Buggy source:
/** 
 * Support for Java   {@link java.lang.Object#notify()} synchronization primitive.
 * @param o the object synchronized on
 * @param l the heavy weight lock
 */
@Override protected void notifyAllInternal(Object o,VM_Lock lock){
  VM_GreenLock l=(VM_GreenLock)lock;
  l.mutex.lock("String_Node_Str");
  VM_GreenThread t=l.waiting.dequeue();
  while (t != null) {
    l.entering.enqueue(t);
    t=l.waiting.dequeue();
  }
  l.mutex.unlock();
}

Fixed version (ground truth):
/** 
 * Support for Java   {@link java.lang.Object#notify()} synchronization primitive.
 * @param o the object synchronized on
 * @param lock the heavy weight lock
 */
@Override protected void notifyAllInternal(Object o,VM_Lock lock){
  VM_GreenLock l=(VM_GreenLock)lock;
  l.mutex.lock("String_Node_Str");
  VM_GreenThread t=l.waiting.dequeue();
  while (t != null) {
    l.entering.enqueue(t);
    t=l.waiting.dequeue();
  }
  l.mutex.unlock();
}
Program: 149908
Project: 149908
Buggy source:
/** 
 * Support for Java   {@link java.lang.Object#notify()} synchronization primitive.
 * @param o the object synchronized on
 * @param l the heavy weight lock
 */
@Override protected void notifyInternal(Object o,VM_Lock lock){
  VM_GreenLock l=(VM_GreenLock)lock;
  l.mutex.lock("String_Node_Str");
  VM_GreenThread t=l.waiting.dequeue();
  if (t != null) {
    l.entering.enqueue(t);
  }
  l.mutex.unlock();
}

Fixed version (ground truth):
/** 
 * Support for Java   {@link java.lang.Object#notify()} synchronization primitive.
 * @param o the object synchronized on
 * @param lock the heavy weight lock
 */
@Override protected void notifyInternal(Object o,VM_Lock lock){
  VM_GreenLock l=(VM_GreenLock)lock;
  l.mutex.lock("String_Node_Str");
  VM_GreenThread t=l.waiting.dequeue();
  if (t != null) {
    l.entering.enqueue(t);
  }
  l.mutex.unlock();
}
Program: 149909
Project: 149909
Buggy source:
/** 
 * The maximum number collection attempts across threads.
 */
public int maximumCollectionAttempt(){
  int max=1;
  for (int t=0; t < VM_Scheduler.getThreadHighWatermark(); t++) {
    VM_Thread thread=VM_Scheduler.threads[t];
    if (thread != null) {
      int current=thread.getCollectionAttempt();
      if (current > max)       max=current;
    }
  }
  return max + VM_CollectorThread.collectionAttemptBase;
}

Fixed version (ground truth):
/** 
 * The maximum number collection attempts across threads.
 */
public int maximumCollectionAttempt(){
  int max=1;
  for (int t=0; t <= VM_Scheduler.getThreadHighWatermark(); t++) {
    VM_Thread thread=VM_Scheduler.threads[t];
    if (thread != null) {
      int current=thread.getCollectionAttempt();
      if (current > max)       max=current;
    }
  }
  return max + VM_CollectorThread.collectionAttemptBase;
}
Program: 149916
Project: 149916
Buggy source:
private void incEdgeCounterIdx(int counters,int scratch,int base,int counterIdx){
  asm.emitADDI(counters,base << 2,counters);
  asm.emitLIntX(scratch,counterIdx,counters);
  asm.emitADDI(scratch,1,scratch);
  asm.emitRLWINM(scratch,scratch,0,1,31);
  asm.emitSTWX(scratch,counterIdx,counters);
}

Fixed version (ground truth):
private void incEdgeCounterIdx(int counters,int scratch,int base,int counterIdx){
  asm.emitADDI(counters,base << 2,counters);
  asm.emitLIntX(scratch,counterIdx,counters);
  asm.emitADDI(scratch,1,scratch);
  asm.emitCMPI(scratch,0);
  VM_ForwardReference fr=asm.emitForwardBC(VM_Assembler.LT);
  asm.emitSTWX(scratch,counterIdx,counters);
  fr.resolve(asm);
}
Program: 149917
Project: 149917
Buggy source:
/** 
 * increment an edge counter.
 * @param counters register containing base of counter array
 * @param scratch scratch register
 * @param counterIdx index of counter to increment
 */
private void incEdgeCounter(int counters,int scratch,int counterIdx){
  asm.emitLInt(scratch,counterIdx << 2,counters);
  asm.emitADDI(scratch,1,scratch);
  asm.emitRLWINM(scratch,scratch,0,1,31);
  asm.emitSTW(scratch,counterIdx << 2,counters);
}

Fixed version (ground truth):
/** 
 * increment an edge counter.
 * @param counters register containing base of counter array
 * @param scratch scratch register
 * @param counterIdx index of counter to increment
 */
private void incEdgeCounter(int counters,int scratch,int counterIdx){
  asm.emitLInt(scratch,counterIdx << 2,counters);
  asm.emitADDI(scratch,1,scratch);
  asm.emitCMPI(scratch,0);
  VM_ForwardReference fr=asm.emitForwardBC(VM_Assembler.LT);
  asm.emitSTW(scratch,counterIdx << 2,counters);
  fr.resolve(asm);
}
Program: 149918
Project: 149918
Buggy source:
/** 
 * A thread's stack has been moved or resized. Adjust the ESP register to reflect new position.
 * @param VM_Registers The registers for this thread
 * @param delta The displacement to be applied
 * @param traceAdjustments Log all adjustments to stderr if true
 */
@Uninterruptible public void adjustESP(VM_Registers registers,Offset delta,boolean traceAdjustments){
  if (VM.VerifyAssertions)   VM._assert(VM.NOT_REACHED);
}

Fixed version (ground truth):
/** 
 * A thread's stack has been moved or resized. Adjust the ESP register to reflect new position.
 * @param registers The registers for this thread
 * @param delta The displacement to be applied
 * @param traceAdjustments Log all adjustments to stderr if true
 */
@Uninterruptible public void adjustESP(VM_Registers registers,Offset delta,boolean traceAdjustments){
  if (VM.VerifyAssertions)   VM._assert(VM.NOT_REACHED);
}