nus-yam/ex-repair huggingface dataset:
Program: 150172
Project: 150172
Buggy source:
void processCondRegion(Vector region) throws IOException {
  QuotedStringTokenizer pst=new QuotedStringTokenizer(params);
  if (!pst.hasMoreTokens())   throw new IOException("String_Node_Str");
  String arg=pst.nextToken();
  if (!pst.hasMoreTokens())   throw new IOException("String_Node_Str");
  String op=pst.nextToken();
  String[] value=new String[pst.countTokens()];
  for (int i=0; i < value.length; i++)   value[i]=pst.nextToken();
  if (DEBUG)   System.out.println("String_Node_Str" + arg + "String_Node_Str"+ op+ "String_Node_Str"+ value[0]);
  Vector newRegion=(Vector)region.elementAt(1);
  if (!evaluateConditional(arg,op,value)) {
    if (region.size() > 2)     newRegion=(Vector)region.elementAt(2);
 else     newRegion=new Vector();
    if (DEBUG)     System.out.println("String_Node_Str");
  }
 else {
    if (DEBUG)     System.out.println("String_Node_Str");
  }
  for (int j=0; j < newRegion.size(); j++) {
    try {
      String currentLine=(String)newRegion.elementAt(j);
      out.print(currentLine + "String_Node_Str");
    }
 catch (    ClassCastException e) {
      Vector tmpRegion=(Vector)newRegion.elementAt(j);
      processTemplateRegion(tmpRegion);
    }
  }
}

Fixed version (ground truth):
void processCondRegion(Vector region) throws IOException {
  QuotedStringTokenizer pst=new QuotedStringTokenizer(params);
  if (!pst.hasMoreTokens())   throw new IOException("String_Node_Str");
  String arg=pst.nextToken();
  if (!pst.hasMoreTokens())   throw new IOException("String_Node_Str");
  String op=pst.nextToken();
  String[] value=new String[pst.countTokens()];
  for (int i=0; i < value.length; i++)   value[i]=pst.nextToken();
  if (DEBUG) {
    if (value.length > 0)     System.out.println("String_Node_Str" + arg + "String_Node_Str"+ op+ "String_Node_Str"+ value[0]);
 else     System.out.println("String_Node_Str" + arg + "String_Node_Str"+ op+ "String_Node_Str");
  }
  Vector newRegion=(Vector)region.elementAt(1);
  if (!evaluateConditional(arg,op,value)) {
    if (region.size() > 2)     newRegion=(Vector)region.elementAt(2);
 else     newRegion=new Vector();
    if (DEBUG)     System.out.println("String_Node_Str");
  }
 else {
    if (DEBUG)     System.out.println("String_Node_Str");
  }
  for (int j=0; j < newRegion.size(); j++) {
    try {
      String currentLine=(String)newRegion.elementAt(j);
      out.print(currentLine + "String_Node_Str");
    }
 catch (    ClassCastException e) {
      Vector tmpRegion=(Vector)newRegion.elementAt(j);
      processTemplateRegion(tmpRegion);
    }
  }
}
Program: 150174
Project: 150174
Buggy source:
/** 
 * Convert address of object or chunk to address of slot in the object map.
 * @param addr The address of the object
 * @return The address of the slot
 */
private static final int addressToSlot(Address addr){
  if (Assert.VERIFY_ASSERTIONS) {
    boolean inHeap=VMResource.refInVM(addr);
    if (!inHeap)     debugln(0,"String_Node_Str",addr);
    Assert._assert(inHeap,"String_Node_Str");
  }
  return (addr.toWord().rshl(SLOT_OFFSET).toInt() & (BITMAPS_IN_PAGEMAP - 1));
}

Fixed version (ground truth):
/** 
 * Convert address of object or chunk to address of slot in the object map.
 * @param addr The address of the object
 * @return The address of the slot
 */
private static final int addressToSlot(Address addr){
  if (Assert.VERIFY_ASSERTIONS) {
    boolean inHeap=VMResource.addressInVM(addr);
    if (!inHeap)     debugln(0,"String_Node_Str",addr);
    Assert._assert(inHeap,"String_Node_Str");
  }
  return (addr.toWord().rshl(SLOT_OFFSET).toInt() & (BITMAPS_IN_PAGEMAP - 1));
}
Program: 150175
Project: 150175
Buggy source:
/** 
 * Convert address of object or chunk to index of page in the object map.
 * @param addr The address of the object
 * @return The address of the slot
 */
private static final int addressToPage(Address addr){
  if (Assert.VERIFY_ASSERTIONS) {
    boolean inHeap=VMResource.refInVM(addr);
    if (!inHeap)     debugln(0,"String_Node_Str",addr);
    Assert._assert(inHeap,"String_Node_Str");
    Assert._assert(((addr.toWord().rshl(PAGE_OFFSET).toInt()) < PAGEMAPS_IN_OBJECTMAP));
  }
  return addr.toWord().rshl(PAGE_OFFSET).toInt();
}

Fixed version (ground truth):
/** 
 * Convert address of object or chunk to index of page in the object map.
 * @param addr The address of the object
 * @return The address of the slot
 */
private static final int addressToPage(Address addr){
  if (Assert.VERIFY_ASSERTIONS) {
    boolean inHeap=VMResource.addressInVM(addr);
    if (!inHeap)     debugln(0,"String_Node_Str",addr);
    Assert._assert(inHeap,"String_Node_Str");
    Assert._assert(((addr.toWord().rshl(PAGE_OFFSET).toInt()) < PAGEMAPS_IN_OBJECTMAP));
  }
  return addr.toWord().rshl(PAGE_OFFSET).toInt();
}
Program: 150176
Project: 150176
Buggy source:
/** 
 * Is the method Uninterruptible? See the comment in   {@link #isInterruptible}
 */
public final boolean isUninterruptible(){
  if (isClassInitializer() || isObjectInitializer())   return false;
  if (isObjectInitializerHelper())   return false;
  if (exceptionTypes != null) {
    if (InterruptiblePragma.declaredBy(this))     return false;
    if (PreemptiblePragma.declaredBy(this))     return false;
    if (UninterruptibleNoWarnPragma.declaredBy(this))     return true;
    if (UninterruptiblePragma.declaredBy(this))     return true;
  }
  VM_Class[] interfaces=getDeclaringClass().getDeclaredInterfaces();
  for (int i=0; i < interfaces.length; i++) {
    if (interfaces[i].isUninterruptibleType())     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Is the method Uninterruptible? See the comment in   {@link #isInterruptible}
 */
public final boolean isUninterruptible(){
  if (isClassInitializer() || isObjectInitializer())   return false;
  if (isObjectInitializerHelper())   return false;
  if (exceptionTypes != null) {
    if (InterruptiblePragma.declaredBy(this))     return false;
    if (PreemptiblePragma.declaredBy(this))     return false;
    if (UnpreemptiblePragma.declaredBy(this))     return false;
    if (UninterruptibleNoWarnPragma.declaredBy(this))     return true;
    if (UninterruptiblePragma.declaredBy(this))     return true;
  }
  VM_Class[] interfaces=getDeclaringClass().getDeclaredInterfaces();
  for (int i=0; i < interfaces.length; i++) {
    if (interfaces[i].isUninterruptibleType())     return true;
  }
  return false;
}
Program: 150177
Project: 150177
Buggy source:
/** 
 * Is the method Unpreemptible? See the comment in   {@link #isInterruptible}
 */
public final boolean isUnpreemptible(){
  if (isClassInitializer() || isObjectInitializer())   return false;
  if (isObjectInitializerHelper())   return false;
  if (exceptionTypes != null) {
    if (InterruptiblePragma.declaredBy(this))     return false;
    if (PreemptiblePragma.declaredBy(this))     return false;
    if (UnpreemptiblePragma.declaredBy(this))     return true;
  }
  VM_Class[] interfaces=getDeclaringClass().getDeclaredInterfaces();
  for (int i=0; i < interfaces.length; i++) {
    if (interfaces[i].isUnpreemptibleType())     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Is the method Unpreemptible? See the comment in   {@link #isInterruptible}
 */
public final boolean isUnpreemptible(){
  if (isClassInitializer() || isObjectInitializer())   return false;
  if (isObjectInitializerHelper())   return false;
  if (exceptionTypes != null) {
    if (InterruptiblePragma.declaredBy(this))     return false;
    if (PreemptiblePragma.declaredBy(this))     return false;
    if (UnpreemptiblePragma.declaredBy(this))     return true;
    if (UninterruptibleNoWarnPragma.declaredBy(this))     return false;
    if (UninterruptiblePragma.declaredBy(this))     return false;
  }
  VM_Class[] interfaces=getDeclaringClass().getDeclaredInterfaces();
  for (int i=0; i < interfaces.length; i++) {
    if (interfaces[i].isUnpreemptibleType())     return true;
  }
  return false;
}
Program: 150179
Project: 150179
Buggy source:
/** 
 * XXX This isn't needed under GNU Classpath 0.11 --- we properly want to create this at the time that we create the Class structure.  That's because the ProtectionDomain associated with a class is a final field in GNU Classpath 0.11's implementation.  
 */
public static void setClassProtectionDomain(Class c,ProtectionDomain pd){
  c.pd=pd;
}

Fixed version (ground truth):
/** 
 * However, under Classpath 0.10, we don't set the ProtectionDomain, and that might be necessary.  We have to use an ugly reflection hack, though, to use Classpath's java.lang.Class, since the field is private. 
 */
public static void setClassProtectionDomain(Class c,ProtectionDomain pd){
  VM_Entrypoints.javaLangClassProtectionDomain.setObjectValueUnchecked(c,pd);
}
Program: 150181
Project: 150181
Buggy source:
/** 
 * Create "main" thread. Taken: args[0]    = name of class containing "main" method args[1..N] = parameters to pass to "main" method
 */
MainThread(String args[]){
  super(args);
  this.args=args;
  this.vmdata.isMainThread=true;
  super.isSystemThread=false;
  if (dbg)   VM.sysWriteln("String_Node_Str",args.length,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Create "main" thread. Taken: args[0]    = name of class containing "main" method args[1..N] = parameters to pass to "main" method
 */
MainThread(String args[]){
  super(args);
  this.args=args;
  this.vmdata.isMainThread=true;
  this.vmdata.isSystemThread=false;
  if (dbg)   VM.sysWriteln("String_Node_Str",args.length,"String_Node_Str");
}
Program: 150182
Project: 150182
Buggy source:
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>all threads</i> execute this.<p> In this case, it means flushing the remsets, rebinding the nursery, and if a full heap collection, preparing the mature space and LOS.
 */
protected final void threadLocalPrepare(int count){
  nursery.rebind(nurseryVM);
  if (fullHeapGC || IGNORE_REMSET) {
    threadLocalMaturePrepare(count);
    los.prepare();
    remset.resetLocal();
  }
 else   if (count == NON_PARTICIPANT)   flushRememberedSets();
}

Fixed version (ground truth):
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>all threads</i> execute this.<p> In this case, it means flushing the remsets, rebinding the nursery, and if a full heap collection, preparing the mature space and LOS.
 */
protected final void threadLocalPrepare(int count){
  nursery.rebind(nurseryVM);
  if (fullHeapGC || IGNORE_REMSET) {
    threadLocalMaturePrepare(count);
    los.prepare();
    remset.resetLocal();
    arrayRemset.resetLocal();
  }
 else   if (count == NON_PARTICIPANT)   flushRememberedSets();
}
Program: 150183
Project: 150183
Buggy source:
/** 
 * Perform operations with <i>global</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>only one thread</i> executes this.<p> In this case, it means flipping semi-spaces, resetting the semi-space memory resource, and preparing each of the collectors.
 */
protected final void globalPrepare(){
  nurseryMR.reset();
  lastGCFull=fullHeapGC;
  if (fullHeapGC || IGNORE_REMSET) {
    if (fullHeapGC)     fullHeapTime.start();
    if (Stats.gatheringStats())     fullHeap.set();
    losSpace.prepare(losVM,losMR);
    globalMaturePrepare();
    ImmortalSpace.prepare(immortalVM,null);
    remsetPool.clearDeque(1);
  }
}

Fixed version (ground truth):
/** 
 * Perform operations with <i>global</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>only one thread</i> executes this.<p> In this case, it means flipping semi-spaces, resetting the semi-space memory resource, and preparing each of the collectors.
 */
protected final void globalPrepare(){
  nurseryMR.reset();
  lastGCFull=fullHeapGC;
  if (fullHeapGC || IGNORE_REMSET) {
    if (fullHeapGC)     fullHeapTime.start();
    if (Stats.gatheringStats())     fullHeap.set();
    losSpace.prepare(losVM,losMR);
    globalMaturePrepare();
    ImmortalSpace.prepare(immortalVM,null);
    remsetPool.clearDeque(1);
    arrayRemsetPool.clearDeque(2);
  }
}
Program: 150184
Project: 150184
Buggy source:
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>all threads</i> execute this.<p> In this case, it means flushing the remsets, rebinding the nursery, and if a full heap collection, preparing the mature space and LOS.
 */
protected final void threadLocalPrepare(int count){
  nursery.rebind(nurseryVM);
  if (fullHeapGC || IGNORE_REMSET) {
    threadLocalMaturePrepare(count);
    los.prepare();
    remset.resetLocal();
  }
 else   if (count == NON_PARTICIPANT)   flushRememberedSets();
}

Fixed version (ground truth):
/** 
 * Perform operations with <i>thread-local</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>all threads</i> execute this.<p> In this case, it means flushing the remsets, rebinding the nursery, and if a full heap collection, preparing the mature space and LOS.
 */
protected final void threadLocalPrepare(int count){
  nursery.rebind(nurseryVM);
  if (fullHeapGC || IGNORE_REMSET) {
    threadLocalMaturePrepare(count);
    los.prepare();
    remset.resetLocal();
    arrayRemset.resetLocal();
  }
 else   if (count == NON_PARTICIPANT)   flushRememberedSets();
}
Program: 150185
Project: 150185
Buggy source:
/** 
 * Perform operations with <i>global</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>only one thread</i> executes this.<p> In this case, it means flipping semi-spaces, resetting the semi-space memory resource, and preparing each of the collectors.
 */
protected final void globalPrepare(){
  nurseryMR.reset();
  lastGCFull=fullHeapGC;
  if (fullHeapGC || IGNORE_REMSET) {
    if (fullHeapGC)     fullHeapTime.start();
    if (Stats.gatheringStats())     fullHeap.set();
    losSpace.prepare(losVM,losMR);
    globalMaturePrepare();
    ImmortalSpace.prepare(immortalVM,null);
    remsetPool.clearDeque(1);
  }
}

Fixed version (ground truth):
/** 
 * Perform operations with <i>global</i> scope in preparation for a collection.  This is called by <code>BasePlan</code>, which will ensure that <i>only one thread</i> executes this.<p> In this case, it means flipping semi-spaces, resetting the semi-space memory resource, and preparing each of the collectors.
 */
protected final void globalPrepare(){
  nurseryMR.reset();
  lastGCFull=fullHeapGC;
  if (fullHeapGC || IGNORE_REMSET) {
    if (fullHeapGC)     fullHeapTime.start();
    if (Stats.gatheringStats())     fullHeap.set();
    losSpace.prepare(losVM,losMR);
    globalMaturePrepare();
    ImmortalSpace.prepare(immortalVM,null);
    remsetPool.clearDeque(1);
    arrayRemsetPool.clearDeque(2);
  }
}
Program: 150186
Project: 150186
Buggy source:
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param ref The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(Address ref,Address typeRef,int bytes,int allocator) throws InlinePragma {
switch (allocator) {
case NURSERY_SPACE:
    return;
case RC_SPACE:
  RefCountLocal.liveObject(ref);
case LOS_SPACE:
modBuffer.push(ref);
RefCountSpace.initializeHeader(ref,typeRef,true);
decBuffer.push(ref);
if (RefCountSpace.RC_SANITY_CHECK) RefCountLocal.sanityAllocCount(ref);
return;
case IMMORTAL_SPACE:
if (RefCountSpace.RC_SANITY_CHECK) rc.addImmortalObject(ref);
modBuffer.push(ref);
return;
default :
if (Assert.VERIFY_ASSERTIONS) Assert.fail("String_Node_Str");
return;
}
}

Fixed version (ground truth):
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param ref The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(Address ref,Address typeRef,int bytes,int allocator) throws InlinePragma {
switch (allocator) {
case NURSERY_SPACE:
    return;
case RC_SPACE:
  RefCountLocal.unsyncLiveObject(ref);
case LOS_SPACE:
modBuffer.push(ref);
RefCountSpace.initializeHeader(ref,typeRef,true);
decBuffer.push(ref);
if (RefCountSpace.RC_SANITY_CHECK) RefCountLocal.sanityAllocCount(ref);
return;
case IMMORTAL_SPACE:
if (RefCountSpace.RC_SANITY_CHECK) rc.addImmortalObject(ref);
modBuffer.push(ref);
return;
default :
if (Assert.VERIFY_ASSERTIONS) Assert.fail("String_Node_Str");
return;
}
}
Program: 150187
Project: 150187
Buggy source:
/** 
 * Perform any post-copy actions.  In this case nothing is required.
 * @param object The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 */
public final void postCopy(Address object,Address typeRef,int bytes) throws InlinePragma {
  CopySpace.clearGCBits(object);
  RefCountSpace.initializeHeader(object,typeRef,false);
  RefCountSpace.makeUnlogged(object);
  RefCountLocal.liveObject(object);
  if (RefCountSpace.RC_SANITY_CHECK) {
    RefCountLocal.sanityAllocCount(object);
  }
}

Fixed version (ground truth):
/** 
 * Perform any post-copy actions.  In this case nothing is required.
 * @param object The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 */
public final void postCopy(Address object,Address typeRef,int bytes) throws InlinePragma {
  CopySpace.clearGCBits(object);
  RefCountSpace.initializeHeader(object,typeRef,false);
  RefCountSpace.makeUnlogged(object);
  RefCountLocal.unsyncLiveObject(object);
  if (RefCountSpace.RC_SANITY_CHECK) {
    RefCountLocal.sanityAllocCount(object);
  }
}
Program: 150188
Project: 150188
Buggy source:
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param object The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(Address object,Address typeRef,int bytes,int allocator) throws InlinePragma {
switch (allocator) {
case RC_SPACE:
    RefCountLocal.liveObject(object);
case LOS_SPACE:
  if (WITH_COALESCING_RC)   modBuffer.pushOOL(object);
decBuffer.pushOOL(object);
if (RefCountSpace.RC_SANITY_CHECK) RefCountLocal.sanityAllocCount(object);
RefCountSpace.initializeHeader(object,typeRef,true);
return;
case IMMORTAL_SPACE:
if (WITH_COALESCING_RC) modBuffer.pushOOL(object);
 else ImmortalSpace.postAlloc(object);
return;
default :
if (Assert.VERIFY_ASSERTIONS) Assert.fail("String_Node_Str");
return;
}
}

Fixed version (ground truth):
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param object The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(Address object,Address typeRef,int bytes,int allocator) throws InlinePragma {
switch (allocator) {
case RC_SPACE:
    RefCountLocal.unsyncLiveObject(object);
case LOS_SPACE:
  if (WITH_COALESCING_RC)   modBuffer.pushOOL(object);
decBuffer.pushOOL(object);
if (RefCountSpace.RC_SANITY_CHECK) RefCountLocal.sanityAllocCount(object);
RefCountSpace.initializeHeader(object,typeRef,true);
return;
case IMMORTAL_SPACE:
if (WITH_COALESCING_RC) modBuffer.pushOOL(object);
 else ImmortalSpace.postAlloc(object);
return;
default :
if (Assert.VERIFY_ASSERTIONS) Assert.fail("String_Node_Str");
return;
}
}
Program: 150189
Project: 150189
Buggy source:
/** 
 * Set the live bit for a given object, without using synchronization primitives---must only be used when contention for live bit is strictly not possible
 * @param object The object whose live bit is to be set.
 */
protected static final void unsyncLiveObject(Address object) throws InlinePragma {
  liveAddress(ObjectModel.refToAddress(object),false);
}

Fixed version (ground truth):
/** 
 * Set the live bit for a given object, without using synchronization primitives---must only be used when contention for live bit is strictly not possible
 * @param object The object whose live bit is to be set.
 */
public static final void unsyncLiveObject(Address object) throws InlinePragma {
  liveAddress(ObjectModel.refToAddress(object),false);
}
Program: 150190
Project: 150190
Buggy source:
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param ref The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(Address ref,Address typeRef,int bytes,int allocator) throws InlinePragma {
switch (allocator) {
case NURSERY_SPACE:
    return;
case RC_SPACE:
  RefCountLocal.liveObject(ref);
case LOS_SPACE:
modBuffer.push(ref);
RefCountSpace.initializeHeader(ref,typeRef,true);
decBuffer.push(ref);
if (RefCountSpace.RC_SANITY_CHECK) RefCountLocal.sanityAllocCount(ref);
return;
case IMMORTAL_SPACE:
if (RefCountSpace.RC_SANITY_CHECK) rc.addImmortalObject(ref);
modBuffer.push(ref);
return;
default :
if (Assert.VERIFY_ASSERTIONS) Assert.fail("String_Node_Str");
return;
}
}

Fixed version (ground truth):
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param ref The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(Address ref,Address typeRef,int bytes,int allocator) throws InlinePragma {
switch (allocator) {
case NURSERY_SPACE:
    return;
case RC_SPACE:
  RefCountLocal.unsyncLiveObject(ref);
case LOS_SPACE:
modBuffer.push(ref);
RefCountSpace.initializeHeader(ref,typeRef,true);
decBuffer.push(ref);
if (RefCountSpace.RC_SANITY_CHECK) RefCountLocal.sanityAllocCount(ref);
return;
case IMMORTAL_SPACE:
if (RefCountSpace.RC_SANITY_CHECK) rc.addImmortalObject(ref);
modBuffer.push(ref);
return;
default :
if (Assert.VERIFY_ASSERTIONS) Assert.fail("String_Node_Str");
return;
}
}
Program: 150191
Project: 150191
Buggy source:
/** 
 * Perform any post-copy actions.  In this case nothing is required.
 * @param object The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 */
public final void postCopy(Address object,Address typeRef,int bytes) throws InlinePragma {
  CopySpace.clearGCBits(object);
  RefCountSpace.initializeHeader(object,typeRef,false);
  RefCountSpace.makeUnlogged(object);
  RefCountLocal.liveObject(object);
  if (RefCountSpace.RC_SANITY_CHECK) {
    RefCountLocal.sanityAllocCount(object);
  }
}

Fixed version (ground truth):
/** 
 * Perform any post-copy actions.  In this case nothing is required.
 * @param object The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 */
public final void postCopy(Address object,Address typeRef,int bytes) throws InlinePragma {
  CopySpace.clearGCBits(object);
  RefCountSpace.initializeHeader(object,typeRef,false);
  RefCountSpace.makeUnlogged(object);
  RefCountLocal.unsyncLiveObject(object);
  if (RefCountSpace.RC_SANITY_CHECK) {
    RefCountLocal.sanityAllocCount(object);
  }
}
Program: 150192
Project: 150192
Buggy source:
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param object The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(Address object,Address typeRef,int bytes,int allocator) throws InlinePragma {
switch (allocator) {
case RC_SPACE:
    RefCountLocal.liveObject(object);
case LOS_SPACE:
  if (WITH_COALESCING_RC)   modBuffer.pushOOL(object);
decBuffer.pushOOL(object);
if (RefCountSpace.RC_SANITY_CHECK) RefCountLocal.sanityAllocCount(object);
RefCountSpace.initializeHeader(object,typeRef,true);
return;
case IMMORTAL_SPACE:
if (WITH_COALESCING_RC) modBuffer.pushOOL(object);
 else ImmortalSpace.postAlloc(object);
return;
default :
if (Assert.VERIFY_ASSERTIONS) Assert.fail("String_Node_Str");
return;
}
}

Fixed version (ground truth):
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param object The newly allocated object
 * @param typeRef the type reference for the instance being created
 * @param bytes The size of the space to be allocated (in bytes)
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(Address object,Address typeRef,int bytes,int allocator) throws InlinePragma {
switch (allocator) {
case RC_SPACE:
    RefCountLocal.unsyncLiveObject(object);
case LOS_SPACE:
  if (WITH_COALESCING_RC)   modBuffer.pushOOL(object);
decBuffer.pushOOL(object);
if (RefCountSpace.RC_SANITY_CHECK) RefCountLocal.sanityAllocCount(object);
RefCountSpace.initializeHeader(object,typeRef,true);
return;
case IMMORTAL_SPACE:
if (WITH_COALESCING_RC) modBuffer.pushOOL(object);
 else ImmortalSpace.postAlloc(object);
return;
default :
if (Assert.VERIFY_ASSERTIONS) Assert.fail("String_Node_Str");
return;
}
}
Program: 150193
Project: 150193
Buggy source:
/** 
 * Set the live bit for a given object, without using synchronization primitives---must only be used when contention for live bit is strictly not possible
 * @param object The object whose live bit is to be set.
 */
protected static final void unsyncLiveObject(Address object) throws InlinePragma {
  liveAddress(ObjectModel.refToAddress(object),false);
}

Fixed version (ground truth):
/** 
 * Set the live bit for a given object, without using synchronization primitives---must only be used when contention for live bit is strictly not possible
 * @param object The object whose live bit is to be set.
 */
public static final void unsyncLiveObject(Address object) throws InlinePragma {
  liveAddress(ObjectModel.refToAddress(object),false);
}
Program: 150194
Project: 150194
Buggy source:
private final void mutateTrapToCall(OPT_Instruction s,VM_Method target){
  int offset=target.getOffset();
  OPT_RegisterOperand tmp=regpool.makeTemp(VM_TypeReference.JavaLangObjectArray);
  OPT_Register JTOC=regpool.getPhysicalRegisterSet().getJTOC();
  OPT_MethodOperand meth=OPT_MethodOperand.STATIC(target);
  meth.setIsNonReturningCall(true);
  if (SI16(offset)) {
    EMIT(MIR_Load.create(PPC_LWZ,tmp,R(JTOC),I(offset)));
  }
 else {
    OPT_RegisterOperand tmp2=regpool.makeTempInt();
    IntConstant(tmp2.register,offset);
    EMIT(MIR_Load.create(PPC_LWZX,tmp,R(JTOC),tmp2));
  }
  EMIT(MIR_Move.create(PPC_MTSPR,R(CTR),tmp.copyD2U()));
  EMIT(MIR_Call.mutate0(s,PPC_BCTRL,null,null,meth));
}

Fixed version (ground truth):
private final void mutateTrapToCall(OPT_Instruction s,VM_Method target){
  int offset=target.getOffset();
  OPT_RegisterOperand tmp=regpool.makeTemp(VM_TypeReference.JavaLangObjectArray);
  OPT_Register JTOC=regpool.getPhysicalRegisterSet().getJTOC();
  OPT_MethodOperand meth=OPT_MethodOperand.STATIC(target);
  meth.setIsNonReturningCall(true);
  if (SI16(offset)) {
    EMIT(MIR_Load.create(PPC_LWZ,tmp,R(JTOC),I(offset)));
    EMIT(MIR_Load.create(PPC64_LD,tmp,L(JTOC),I(offset)));
  }
 else {
    OPT_RegisterOperand tmp2=regpool.makeTempInt();
    IntConstant(tmp2.register,offset);
    EMIT(MIR_Load.create(PPC_LWZX,tmp,R(JTOC),tmp2));
    EMIT(MIR_Load.create(PPC64_LDX,tmp,L(JTOC),tmp2));
  }
  EMIT(MIR_Move.create(PPC_MTSPR,R(CTR),tmp.copyD2U()));
  EMIT(MIR_Move.create(PPC_MTSPR,L(CTR),tmp.copyD2U()));
  EMIT(MIR_Call.mutate0(s,PPC_BCTRL,null,null,meth));
}
Program: 150198
Project: 150198
Buggy source:
/** 
 * Expand a checkcast instruction into the LIR sequence that implements the  dynamic type check, raising a ClassCastException when the type check  fails. Ref is known to never contain a null ptr at runtime.
 * @param s a CHECKCAST_NOTNULL instruction to expand 
 * @param ir the enclosing OPT_IR
 * @return the last OPT_Instruction in the generated LIR sequence.
 */
static OPT_Instruction checkcastNotNull(OPT_Instruction s,OPT_IR ir){
  OPT_Operand ref=TypeCheck.getClearRef(s);
  VM_TypeReference LHStype=TypeCheck.getType(s).getTypeRef();
  OPT_Operand guard=TypeCheck.getClearGuard(s);
  OPT_BasicBlock myBlock=s.getBasicBlock();
  OPT_BasicBlock failBlock=myBlock.createSubBlock(s.bcIndex,ir,.0001f);
  OPT_BasicBlock succBlock=myBlock.splitNodeAt(s,ir);
  myBlock.insertOut(failBlock);
  myBlock.insertOut(succBlock);
  ir.cfg.linkInCodeOrder(myBlock,succBlock);
  ir.cfg.addLastInCodeOrder(failBlock);
  OPT_Instruction raiseError=Trap.create(TRAP,null,OPT_TrapCodeOperand.CheckCast());
  raiseError.copyPosition(s);
  failBlock.appendInstruction(raiseError);
  OPT_RegisterOperand RHStib=getTIB(s,ir,ref,guard);
  return generateBranchingTypeCheck(s,ir,ref,LHStype,RHStib,succBlock,failBlock,null);
}

Fixed version (ground truth):
/** 
 * Expand a checkcast instruction into the LIR sequence that implements the  dynamic type check, raising a ClassCastException when the type check  fails. Ref is known to never contain a null ptr at runtime.
 * @param s a CHECKCAST_NOTNULL instruction to expand 
 * @param ir the enclosing OPT_IR
 * @return the last OPT_Instruction in the generated LIR sequence.
 */
static OPT_Instruction checkcastNotNull(OPT_Instruction s,OPT_IR ir){
  OPT_Operand ref=TypeCheck.getClearRef(s);
  VM_TypeReference LHStype=TypeCheck.getType(s).getTypeRef();
  OPT_Operand guard=TypeCheck.getClearGuard(s);
  OPT_BasicBlock myBlock=s.getBasicBlock();
  OPT_BasicBlock failBlock=myBlock.createSubBlock(s.bcIndex,ir,.0001f);
  OPT_BasicBlock succBlock=myBlock.splitNodeAt(s,ir);
  myBlock.insertOut(failBlock);
  myBlock.insertOut(succBlock);
  ir.cfg.linkInCodeOrder(myBlock,succBlock);
  ir.cfg.addLastInCodeOrder(failBlock);
  OPT_Instruction raiseError=Trap.create(TRAP,null,OPT_TrapCodeOperand.CheckCast());
  raiseError.copyPosition(s);
  failBlock.appendInstruction(raiseError);
  OPT_RegisterOperand RHStib=getTIB(s,ir,ref,guard);
  return generateBranchingTypeCheck(s,ir,ref,LHStype,RHStib,succBlock,failBlock,null,OPT_BranchProfileOperand.never());
}
Program: 150203
Project: 150203
Buggy source:
/** 
 * Common code shared by the JNI functions Call<type>Method (virtual method invocation)
 * @param obj the object instance 
 * @param methodID the method ID
 * @param expectReturnType the return type for checking purpose
 * @param skip4Args  true if the calling JNI Function takes 4 args before the varargfalse if the calling JNI Function takes 3 args before the vararg
 * @return an object that may be the return object or a wrapper for the primitive return value 
 */
public static Object invokeWithDotDotVarArg(Object obj,int methodID,VM_TypeReference expectReturnType,boolean skip4Args) throws Exception, VM_PragmaNoInline {
  VM_Address varargAddress=pushVarArgToSpillArea(methodID,skip4Args);
  return packageAndInvoke(obj,methodID,varargAddress,expectReturnType,skip4Args,AIX_VARARG);
  VM_Address glueFP=VM_Magic.getCallerFramePointer(VM_Magic.getCallerFramePointer(VM_Magic.getFramePointer()));
  return packageAndInvoke(obj,methodID,glueFP,expectReturnType,skip4Args,SVR4_DOTARG);
}

Fixed version (ground truth):
/** 
 * Common code shared by the JNI functions Call<type>Method (virtual method invocation)
 * @param obj the object instance 
 * @param methodID the method ID
 * @param expectReturnType the return type for checking purpose
 * @param skip4Args  true if the calling JNI Function takes 4 args before the varargfalse if the calling JNI Function takes 3 args before the vararg
 * @return an object that may be the return object or a wrapper for the primitive return value 
 */
public static Object invokeWithDotDotVarArg(Object obj,int methodID,VM_TypeReference expectReturnType,boolean skip4Args) throws Exception, VM_PragmaNoInline {
  VM_Address varargAddress=pushVarArgToSpillArea(methodID,skip4Args);
  return packageAndInvoke(obj,methodID,varargAddress,expectReturnType,skip4Args,AIX_VARARG);
  VM_Address glueFP=VM_Magic.getCallerFramePointer(VM_Magic.getCallerFramePointer(VM_Magic.getFramePointer()));
  return packageAndInvoke(obj,methodID,glueFP,expectReturnType,skip4Args,SVR4_DOTARG);
  VM_Address varargAddress=pushVarArgToSpillArea(methodID,skip4Args);
  return packageAndInvoke(obj,methodID,varargAddress,expectReturnType,skip4Args,OSX_DOTARG);
}
Program: 150206
Project: 150206
Buggy source:
/** 
 * The current frame is expected to be one of the JNI functions  called from C,  below which is one or more native stack frames Skip over all frames below with saved code pointers outside of heap  (C frames),  stopping at the native frame immediately preceding the glue frame which  contains the method ID of the native method  (this is necessary to allow retrieving the  return address of the glue frame) Ton Ngo 7/30/01
 */
public static VM_Address unwindNativeStackFrame(VM_Address currfp) throws VM_PragmaUninterruptible {
  VM_Address ip, callee_fp;
  VM_Address fp=VM_Magic.getCallerFramePointer(currfp);
  do {
    callee_fp=fp;
    ip=VM_Magic.getReturnAddress(fp);
    fp=VM_Magic.getCallerFramePointer(fp);
  }
 while (!MM_Interface.refInVM(ip) && fp.NE(STACKFRAME_SENTINEL_FP));
  if (VM.BuildForPowerPC) {
    if (VM.BuildForSVR4ABI || VM.BuildForMachOABI) {
      if (MM_Interface.refInVM(ip)) {
        return fp;
      }
 else {
        return callee_fp;
      }
    }
 else {
      return callee_fp;
    }
  }
 else {
    return callee_fp;
  }
}

Fixed version (ground truth):
/** 
 * The current frame is expected to be one of the JNI functions  called from C,  below which is one or more native stack frames Skip over all frames below with saved code pointers outside of heap  (C frames),  stopping at the native frame immediately preceding the glue frame which  contains the method ID of the native method  (this is necessary to allow retrieving the  return address of the glue frame) Ton Ngo 7/30/01
 */
public static VM_Address unwindNativeStackFrame(VM_Address currfp) throws VM_PragmaUninterruptible {
  VM_Address ip, callee_fp;
  VM_Address fp=VM_Magic.getCallerFramePointer(currfp);
  do {
    callee_fp=fp;
    ip=VM_Magic.getReturnAddress(fp);
    fp=VM_Magic.getCallerFramePointer(fp);
  }
 while (!MM_Interface.refInVM(ip) && fp.NE(STACKFRAME_SENTINEL_FP));
  if (VM.BuildForPowerPC) {
    if (VM.BuildForSVR4ABI) {
      if (MM_Interface.refInVM(ip)) {
        return fp;
      }
 else {
        return callee_fp;
      }
    }
 else {
      return callee_fp;
    }
  }
 else {
    return callee_fp;
  }
}
Program: 150207
Project: 150207
Buggy source:
/** 
 * Allocate a stack
 * @param n The number of bytes to allocate
 * @param immortal  Is the stack immortal and non-moving?
 * @return The stack
 */
public static byte[] newStack(int bytes,boolean immortal) throws VM_PragmaInline, VM_PragmaInterruptible {
  if (!immortal || !VM.runningVM)   return new byte[bytes];
  int logAlignment=12;
  int alignment=1 << logAlignment;
  VM_Array stackType=VM_Array.ByteArray;
  Object[] stackTib=stackType.getTypeInformationBlock();
  int offset=VM_JavaHeader.computeArrayHeaderSize(stackType);
  int arraySize=VM_Memory.alignUp(stackType.getInstanceSize(bytes),BYTES_IN_PARTICLE);
  int fullSize=VM_Memory.alignUp(arraySize + alignment,BYTES_IN_PARTICLE);
  if (VM.VerifyAssertions)   VM._assert(alignment > offset);
  VM_Address fullRegion=VM_Interface.getPlan().alloc(fullSize,BYTES_IN_PARTICLE,0,Plan.IMMORTAL_SPACE);
  VM_Address tmp=fullRegion.add(alignment);
  VM_Word mask=VM_Word.one().lsh(logAlignment).sub(VM_Word.one()).not();
  VM_Address region=tmp.toWord().and(mask).sub(VM_Word.fromIntSignExtend(offset)).toAddress();
  Object result=VM_ObjectModel.initializeArray(region,stackTib,bytes,arraySize);
  VM_Interface.getPlan().postAlloc(VM_Magic.objectAsAddress(result),stackTib,arraySize,Plan.IMMORTAL_SPACE);
  return (byte[])result;
}

Fixed version (ground truth):
/** 
 * Allocate a stack
 * @param n The number of bytes to allocate
 * @param immortal  Is the stack immortal and non-moving?
 * @return The stack
 */
public static byte[] newStack(int bytes,boolean immortal) throws VM_PragmaInline, VM_PragmaInterruptible {
  if (!immortal || !VM.runningVM) {
    return new byte[bytes];
  }
 else {
    VM_Array stackType=VM_Array.ByteArray;
    int headerSize=VM_ObjectModel.computeArrayHeaderSize(stackType);
    int align=VM_ObjectModel.getAlignment(stackType);
    int offset=VM_ObjectModel.getOffsetForAlignment(stackType);
    int width=stackType.getLogElementSize();
    Object[] stackTib=stackType.getTypeInformationBlock();
    return (byte[])allocateArray(bytes,width,headerSize,stackTib,Plan.IMMORTAL_SPACE,align,offset);
  }
}
Program: 150208
Project: 150208
Buggy source:
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param ref The newly allocated object
 * @param tib The TIB of the newly allocated object
 * @param bytes The size of the space to be allocated (in bytes)
 * @param isScalar True if the object occupying this space will be a scalar
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(VM_Address ref,Object[] tib,int bytes,boolean isScalar,int allocator) throws VM_PragmaInline {
switch (allocator) {
case DEFAULT_SPACE:
    Header.initializeHeader(ref,tib,bytes,isScalar);
  return;
case IMMORTAL_SPACE:
ImmortalSpace.postAlloc(ref);
return;
default :
if (VM_Interface.VerifyAssertions) VM_Interface.sysFail("String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Perform post-allocation actions.  For many allocators none are required.
 * @param ref The newly allocated object
 * @param tib The TIB of the newly allocated object
 * @param bytes The size of the space to be allocated (in bytes)
 * @param isScalar True if the object occupying this space will be a scalar
 * @param allocator The allocator number to be used for this allocation
 */
public final void postAlloc(VM_Address ref,Object[] tib,int bytes,boolean isScalar,int allocator) throws VM_PragmaInline {
switch (allocator) {
case LOS_SPACE:
case DEFAULT_SPACE:
    Header.initializeHeader(ref,tib,bytes,isScalar);
  return;
case IMMORTAL_SPACE:
ImmortalSpace.postAlloc(ref);
return;
default :
if (VM_Interface.VerifyAssertions) VM_Interface.sysFail("String_Node_Str");
}
}
Program: 150209
Project: 150209
Buggy source:
/** 
 * Return true if <code>obj</code> is a live object.
 * @param obj The object in question
 * @return True if <code>obj</code> is a live object.
 */
public static final boolean isLive(VM_Address obj){
  if (obj.isZero())   return false;
  VM_Address addr=VM_Interface.refToAddress(obj);
  byte space=VMResource.getSpace(addr);
switch (space) {
case DEFAULT_SPACE:
    return true;
case IMMORTAL_SPACE:
  return true;
case BOOT_SPACE:
return true;
case META_SPACE:
return true;
default :
if (VM_Interface.VerifyAssertions) spaceFailure(obj,space,"String_Node_Str");
return false;
}
}

Fixed version (ground truth):
/** 
 * Return true if <code>obj</code> is a live object.
 * @param obj The object in question
 * @return True if <code>obj</code> is a live object.
 */
public static final boolean isLive(VM_Address obj){
  if (obj.isZero())   return false;
  VM_Address addr=VM_Interface.refToAddress(obj);
  byte space=VMResource.getSpace(addr);
switch (space) {
case LOS_SPACE:
    return true;
case DEFAULT_SPACE:
  return true;
case IMMORTAL_SPACE:
return true;
case BOOT_SPACE:
return true;
case META_SPACE:
return true;
default :
if (VM_Interface.VerifyAssertions) spaceFailure(obj,space,"String_Node_Str");
return false;
}
}
Program: 150210
Project: 150210
Buggy source:
/** 
 * Allocate space (for an object)
 * @param bytes The size of the space to be allocated (in bytes)
 * @param isScalar True if the object occupying this space will be a scalar
 * @param allocator The allocator number to be used for this allocation
 * @return The address of the first byte of the allocated region
 */
public final VM_Address alloc(int bytes,boolean isScalar,int allocator) throws VM_PragmaInline {
switch (allocator) {
case DEFAULT_SPACE:
    return def.alloc(isScalar,bytes);
case IMMORTAL_SPACE:
  return immortal.alloc(isScalar,bytes);
default :
if (VM_Interface.VerifyAssertions) VM_Interface.sysFail("String_Node_Str");
return VM_Address.zero();
}
}

Fixed version (ground truth):
/** 
 * Allocate space (for an object)
 * @param bytes The size of the space to be allocated (in bytes)
 * @param isScalar True if the object occupying this space will be a scalar
 * @param allocator The allocator number to be used for this allocation
 * @return The address of the first byte of the allocated region
 */
public final VM_Address alloc(int bytes,boolean isScalar,int allocator) throws VM_PragmaInline {
switch (allocator) {
case LOS_SPACE:
case DEFAULT_SPACE:
    return def.alloc(isScalar,bytes);
case IMMORTAL_SPACE:
  return immortal.alloc(isScalar,bytes);
default :
if (VM_Interface.VerifyAssertions) VM_Interface.sysFail("String_Node_Str");
return VM_Address.zero();
}
}
Program: 150211
Project: 150211
Buggy source:
/** 
 * Allocate a large object.  Large objects are directly allocted and freed in page-grained units via the vm resource.  This routine returned zeroed memory.
 * @param bytes The required size of this space in bytes.
 * @param align The requested alignment.
 * @param offset The alignment offset.
 * @param inGC If true, this allocation is occuring with respect toa space that is currently being collected.
 * @return The address of the start of the newly allocated region atleast <code>bytes</code> bytes in size.
 */
final protected VM_Address allocSlowOnce(int bytes,int align,int offset,boolean inGC){
  int header=superPageHeaderSize() + cellHeaderSize();
  int pages=(getMaximumAlignedSize(bytes + header,align) + BYTES_IN_PAGE - 1) >> LOG_BYTES_IN_PAGE;
  VM_Address sp=allocSuperPage(pages);
  if (sp.isZero())   return sp;
  VM_Address cell=alignAllocation(sp.add(header),align,offset);
  Memory.zero(cell,VM_Extent.fromIntZeroExtend(bytes));
  return cell;
}

Fixed version (ground truth):
/** 
 * Allocate a large object.  Large objects are directly allocted and freed in page-grained units via the vm resource.  This routine returned zeroed memory.
 * @param bytes The required size of this space in bytes.
 * @param align The requested alignment.
 * @param offset The alignment offset.
 * @param inGC If true, this allocation is occuring with respect toa space that is currently being collected.
 * @return The address of the start of the newly allocated region atleast <code>bytes</code> bytes in size.
 */
final protected VM_Address allocSlowOnce(int bytes,int align,int offset,boolean inGC){
  int header=superPageHeaderSize() + cellHeaderSize();
  int maxbytes=getMaximumAlignedSize(bytes + header,align);
  int pages=(maxbytes + BYTES_IN_PAGE - 1) >> LOG_BYTES_IN_PAGE;
  VM_Address sp=allocSuperPage(pages);
  if (sp.isZero())   return sp;
  VM_Address cell=sp.add(header);
  Memory.zero(cell,VM_Extent.fromIntZeroExtend(maxbytes));
  return cell;
}
Program: 150212
Project: 150212
Buggy source:
/** 
 * Allocate space for an object
 * @param bytes The number of bytes allocated
 * @param align The requested alignment.
 * @param offset The alignment offset.
 * @return The address of the first byte of the allocated cell Willnot return zero.
 */
public final VM_Address alloc(int bytes,int align,int offset) throws VM_PragmaNoInline {
  VM_Address cell=allocSlow(bytes,align,offset,false);
  postAlloc(cell);
  return cell;
}

Fixed version (ground truth):
/** 
 * Allocate space for an object
 * @param bytes The number of bytes allocated
 * @param align The requested alignment.
 * @param offset The alignment offset.
 * @return The address of the first byte of the allocated cell Willnot return zero.
 */
public final VM_Address alloc(int bytes,int align,int offset) throws VM_PragmaNoInline {
  VM_Address cell=allocSlow(bytes,align,offset,false);
  postAlloc(cell);
  return alignAllocation(cell,align,offset);
}
Program: 150213
Project: 150213
Buggy source:
/** 
 * Allocate a large object.  Large objects are directly allocted and freed in page-grained units via the vm resource.  This routine returned zeroed memory.
 * @param bytes The required size of this space in bytes.
 * @param align The requested alignment.
 * @param offset The alignment offset.
 * @param inGC If true, this allocation is occuring with respect toa space that is currently being collected.
 * @return The address of the start of the newly allocated region atleast <code>bytes</code> bytes in size.
 */
final protected VM_Address allocSlowOnce(int bytes,int align,int offset,boolean inGC){
  int header=superPageHeaderSize() + cellHeaderSize();
  int pages=(getMaximumAlignedSize(bytes + header,align) + BYTES_IN_PAGE - 1) >> LOG_BYTES_IN_PAGE;
  VM_Address sp=allocSuperPage(pages);
  if (sp.isZero())   return sp;
  VM_Address cell=alignAllocation(sp.add(header),align,offset);
  Memory.zero(cell,VM_Extent.fromIntZeroExtend(bytes));
  return cell;
}

Fixed version (ground truth):
/** 
 * Allocate a large object.  Large objects are directly allocted and freed in page-grained units via the vm resource.  This routine returned zeroed memory.
 * @param bytes The required size of this space in bytes.
 * @param align The requested alignment.
 * @param offset The alignment offset.
 * @param inGC If true, this allocation is occuring with respect toa space that is currently being collected.
 * @return The address of the start of the newly allocated region atleast <code>bytes</code> bytes in size.
 */
final protected VM_Address allocSlowOnce(int bytes,int align,int offset,boolean inGC){
  int header=superPageHeaderSize() + cellHeaderSize();
  int maxbytes=getMaximumAlignedSize(bytes + header,align);
  int pages=(maxbytes + BYTES_IN_PAGE - 1) >> LOG_BYTES_IN_PAGE;
  VM_Address sp=allocSuperPage(pages);
  if (sp.isZero())   return sp;
  VM_Address cell=sp.add(header);
  Memory.zero(cell,VM_Extent.fromIntZeroExtend(maxbytes));
  return cell;
}
Program: 150214
Project: 150214
Buggy source:
/** 
 * Allocate space for an object
 * @param bytes The number of bytes allocated
 * @param align The requested alignment.
 * @param offset The alignment offset.
 * @return The address of the first byte of the allocated cell Willnot return zero.
 */
public final VM_Address alloc(int bytes,int align,int offset) throws VM_PragmaNoInline {
  VM_Address cell=allocSlow(bytes,align,offset,false);
  postAlloc(cell);
  return cell;
}

Fixed version (ground truth):
/** 
 * Allocate space for an object
 * @param bytes The number of bytes allocated
 * @param align The requested alignment.
 * @param offset The alignment offset.
 * @return The address of the first byte of the allocated cell Willnot return zero.
 */
public final VM_Address alloc(int bytes,int align,int offset) throws VM_PragmaNoInline {
  VM_Address cell=allocSlow(bytes,align,offset,false);
  postAlloc(cell);
  return alignAllocation(cell,align,offset);
}