Program: 84559
Project: 84559
Buggy source:
@Override public void write(ClassWriter writer) throws BytecodeException {
  String internalName=this.getInternalName();
  String signature=this.getSignature();
  String superClass=null;
  String[] interfaces=this.getInterfaceArray();
  if (this.superType != null) {
    superClass=this.superType.getInternalName();
  }
  int mods=this.modifiers & 0x7631;
  if ((mods & Modifiers.INTERFACE_CLASS) != Modifiers.INTERFACE_CLASS) {
    mods|=Opcodes.ACC_SUPER;
  }
  writer.visit(DyvilCompiler.classVersion,mods,internalName,signature,superClass,interfaces);
  if (this.outerClass != null) {
    writer.visitOuterClass(this.outerClass.getInternalName(),null,null);
  }
  if ((this.modifiers & Modifiers.OBJECT_CLASS) != 0) {
    writer.visitAnnotation("String_Node_Str",true);
  }
  if ((this.modifiers & Modifiers.SEALED) != 0) {
    writer.visitAnnotation("String_Node_Str",false);
  }
  if ((this.modifiers & Modifiers.DEPRECATED) != 0) {
    writer.visitAnnotation("String_Node_Str",true);
  }
  if ((this.modifiers & Modifiers.FUNCTIONAL) != 0) {
    writer.visitAnnotation("String_Node_Str",true);
  }
  for (int i=0; i < this.annotationCount; i++) {
    this.annotations[i].write(writer);
  }
  if (this.outerClass != null) {
    this.writeInnerClassInfo(writer);
  }
  if (this.superType != null) {
    IClass iclass=this.superType.getTheClass();
    if (iclass != null) {
      iclass.writeInnerClassInfo(writer);
    }
  }
  for (int i=0; i < this.interfaceCount; i++) {
    IType type=this.interfaces[i];
    IClass iclass=type.getTheClass();
    if (iclass != null) {
      iclass.writeInnerClassInfo(writer);
    }
  }
  for (int i=0; i < this.genericCount; i++) {
    this.generics[i].write(writer);
  }
  int fields=0;
  int constructors=0;
  int methods=0;
  int properties=0;
  if (this.body != null) {
    fields=this.body.fieldCount();
    methods=this.body.methodCount();
    constructors=this.body.constructorCount();
    properties=this.body.propertyCount();
    int classes=this.body.classCount();
    for (int i=0; i < classes; i++) {
      this.body.getClass(i).writeInnerClassInfo(writer);
    }
  }
  ThisValue thisValue=new ThisValue(this.type);
  StatementList instanceFields=new StatementList();
  IField[] staticFields=new IField[fields + 1];
  int staticFieldCount=0;
  for (int i=0; i < fields; i++) {
    IField f=this.body.getField(i);
    f.write(writer);
    if (f.hasModifier(Modifiers.LAZY)) {
      continue;
    }
    if (f.hasModifier(Modifiers.STATIC)) {
      staticFields[staticFieldCount++]=f;
    }
 else {
      FieldAssign assign=new FieldAssign(null);
      assign.name=f.getName();
      assign.instance=thisValue;
      assign.value=f.getValue();
      assign.field=f;
      instanceFields.addValue(assign);
    }
  }
  for (int i=0; i < this.parameterCount; i++) {
    this.parameters[i].write(writer);
  }
  for (int i=0; i < constructors; i++) {
    this.body.getConstructor(i).write(writer,instanceFields);
  }
  for (int i=0; i < properties; i++) {
    this.body.getProperty(i).write(writer);
  }
  for (int i=0; i < methods; i++) {
    this.body.getMethod(i).write(writer);
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].write(writer);
  }
  this.metadata.write(writer,instanceFields);
  MethodWriter mw=new MethodWriterImpl(writer,writer.visitMethod(Modifiers.STATIC,"String_Node_Str","String_Node_Str",null,null));
  mw.begin();
  this.metadata.writeStaticInit(mw);
  for (int i=0; i < staticFieldCount; i++) {
    staticFields[i].writeStaticInit(mw);
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeStaticInit(mw);
  }
  mw.end(Types.VOID);
}

Fixed version (ground truth):
@Override public void write(ClassWriter writer) throws BytecodeException {
  String internalName=this.getInternalName();
  String signature=this.getSignature();
  String superClass=null;
  String[] interfaces=this.getInterfaceArray();
  if (this.superType != null) {
    superClass=this.superType.getInternalName();
  }
  int mods=this.modifiers & 0x7631;
  if ((mods & Modifiers.INTERFACE_CLASS) != Modifiers.INTERFACE_CLASS) {
    mods|=Opcodes.ACC_SUPER;
  }
  writer.visit(DyvilCompiler.classVersion,mods,internalName,signature,superClass,interfaces);
  if (this.outerClass != null) {
    writer.visitOuterClass(this.outerClass.getInternalName(),null,null);
  }
  if ((this.modifiers & Modifiers.OBJECT_CLASS) != 0) {
    writer.visitAnnotation("String_Node_Str",true);
  }
  if ((this.modifiers & Modifiers.SEALED) != 0) {
    writer.visitAnnotation("String_Node_Str",false);
  }
  if ((this.modifiers & Modifiers.DEPRECATED) != 0) {
    writer.visitAnnotation("String_Node_Str",true);
  }
  if ((this.modifiers & Modifiers.FUNCTIONAL) != 0) {
    writer.visitAnnotation("String_Node_Str",true);
  }
  for (int i=0; i < this.annotationCount; i++) {
    this.annotations[i].write(writer);
  }
  if (this.outerClass != null) {
    this.writeInnerClassInfo(writer);
  }
  if (this.superType != null) {
    IClass iclass=this.superType.getTheClass();
    if (iclass != null) {
      iclass.writeInnerClassInfo(writer);
    }
  }
  for (int i=0; i < this.interfaceCount; i++) {
    IType type=this.interfaces[i];
    IClass iclass=type.getTheClass();
    if (iclass != null) {
      iclass.writeInnerClassInfo(writer);
    }
  }
  for (int i=0; i < this.genericCount; i++) {
    this.generics[i].write(writer);
  }
  int fields=0;
  int constructors=0;
  int methods=0;
  int properties=0;
  if (this.body != null) {
    fields=this.body.fieldCount();
    methods=this.body.methodCount();
    constructors=this.body.constructorCount();
    properties=this.body.propertyCount();
    int classes=this.body.classCount();
    for (int i=0; i < classes; i++) {
      this.body.getClass(i).writeInnerClassInfo(writer);
    }
  }
  ThisValue thisValue=new ThisValue(this.type);
  StatementList instanceFields=new StatementList();
  IField[] staticFields=new IField[fields + 1];
  int staticFieldCount=0;
  for (int i=0; i < fields; i++) {
    IField f=this.body.getField(i);
    f.write(writer);
    if (f.hasModifier(Modifiers.LAZY)) {
      continue;
    }
    if (f.hasModifier(Modifiers.STATIC)) {
      staticFields[staticFieldCount++]=f;
    }
 else {
      FieldAssign assign=new FieldAssign(null);
      assign.name=f.getName();
      assign.instance=thisValue;
      assign.value=f.getValue();
      assign.field=f;
      instanceFields.addValue(assign);
    }
  }
  if (this.parameterCount > 0) {
    AnnotationVisitor av=writer.visitAnnotation("String_Node_Str",false);
    AnnotationVisitor array=av.visitArray("String_Node_Str");
    for (int i=0; i < this.parameterCount; i++) {
      IParameter param=this.parameters[i];
      param.write(writer);
      array.visit("String_Node_Str",param.getName().qualified);
    }
    array.visitEnd();
  }
  for (int i=0; i < constructors; i++) {
    this.body.getConstructor(i).write(writer,instanceFields);
  }
  for (int i=0; i < properties; i++) {
    this.body.getProperty(i).write(writer);
  }
  for (int i=0; i < methods; i++) {
    this.body.getMethod(i).write(writer);
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].write(writer);
  }
  this.metadata.write(writer,instanceFields);
  MethodWriter mw=new MethodWriterImpl(writer,writer.visitMethod(Modifiers.STATIC,"String_Node_Str","String_Node_Str",null,null));
  mw.begin();
  this.metadata.writeStaticInit(mw);
  for (int i=0; i < staticFieldCount; i++) {
    staticFields[i].writeStaticInit(mw);
  }
  for (int i=0; i < this.compilableCount; i++) {
    this.compilables[i].writeStaticInit(mw);
  }
  mw.end(Types.VOID);
}