Program: 85102
Project: 85102
Buggy source:
@Override public void writeStatement(MethodWriter writer){
  org.objectweb.asm.Label startLabel=this.startLabel.target;
  org.objectweb.asm.Label updateLabel=this.updateLabel.target;
  org.objectweb.asm.Label endLabel=this.endLabel.target;
  Variable var=this.variable;
  if (this.type == DEFAULT) {
    int locals=writer.registerLocal();
    if (var != null) {
      var.value.writeExpression(writer);
      var.index=locals;
      writer.writeVarInsn(var.type.getStoreOpcode(),var.index);
    }
    writer.writeLabel(startLabel);
    if (this.condition != null) {
      this.condition.writeInvJump(writer,endLabel);
    }
    if (this.then != null) {
      this.then.writeStatement(writer);
    }
    writer.writeLabel(updateLabel);
    if (this.update != null) {
      this.update.writeStatement(writer);
    }
    writer.writeJumpInsn(Opcodes.GOTO,startLabel);
    writer.resetLocals(locals);
    writer.writeLabel(endLabel);
    if (var != null) {
      writer.writeLocal(var.name.qualified,var.type,startLabel,endLabel,var.index);
    }
    return;
  }
  if (this.type == ARRAY) {
    int locals=writer.registerLocal();
    Variable arrayVar=this.var3;
    Variable indexVar=this.var1;
    Variable lengthVar=this.var2;
    org.objectweb.asm.Label scopeLabel=new org.objectweb.asm.Label();
    writer.writeLabel(scopeLabel);
    var.value.writeExpression(writer);
    var.index=locals + 1;
    indexVar.index=locals + 2;
    lengthVar.index=locals + 3;
    arrayVar.index=locals + 4;
    writer.writeInsn(Opcodes.DUP);
    arrayVar.writeSet(writer,null,null);
    writer.writeInsn(Opcodes.ARRAYLENGTH);
    lengthVar.writeSet(writer,null,null);
    writer.writeLDC(0);
    indexVar.writeSet(writer,null,null);
    writer.writeJumpInsn(Opcodes.GOTO,updateLabel);
    writer.writeLabel(startLabel);
    arrayVar.writeGet(writer,null);
    indexVar.writeGet(writer,null);
    writer.writeInsn(arrayVar.type.getArrayLoadOpcode());
    var.writeSet(writer,null,null);
    if (this.then != null) {
      this.then.writeStatement(writer);
    }
    writer.writeIINC(indexVar.index,1);
    writer.writeLabel(updateLabel);
    indexVar.writeGet(writer,null);
    lengthVar.writeGet(writer,null);
    writer.writeJumpInsn(Opcodes.IF_ICMPLT,startLabel);
    writer.resetLocals(locals);
    writer.writeLabel(endLabel);
    writer.writeLocal(var.name.qualified,var.type,scopeLabel,endLabel,var.index);
    writer.writeLocal("String_Node_Str","String_Node_Str",null,scopeLabel,endLabel,indexVar.index);
    writer.writeLocal("String_Node_Str","String_Node_Str",null,scopeLabel,endLabel,lengthVar.index);
    writer.writeLocal("String_Node_Str",arrayVar.type,scopeLabel,endLabel,arrayVar.index);
    return;
  }
}

Fixed version (ground truth):
@Override public void writeStatement(MethodWriter writer){
  org.objectweb.asm.Label startLabel=this.startLabel.target=new org.objectweb.asm.Label();
  org.objectweb.asm.Label updateLabel=this.updateLabel.target=new org.objectweb.asm.Label();
  org.objectweb.asm.Label endLabel=this.endLabel.target=new org.objectweb.asm.Label();
  Variable var=this.variable;
  if (this.type == DEFAULT) {
    int locals=writer.registerLocal();
    if (var != null) {
      var.value.writeExpression(writer);
      var.index=locals;
      writer.writeVarInsn(var.type.getStoreOpcode(),var.index);
    }
    writer.writeLabel(startLabel);
    if (this.condition != null) {
      this.condition.writeInvJump(writer,endLabel);
    }
    if (this.then != null) {
      this.then.writeStatement(writer);
    }
    writer.writeLabel(updateLabel);
    if (this.update != null) {
      this.update.writeStatement(writer);
    }
    writer.writeJumpInsn(Opcodes.GOTO,startLabel);
    writer.resetLocals(locals);
    writer.writeLabel(endLabel);
    if (var != null) {
      writer.writeLocal(var.name.qualified,var.type,startLabel,endLabel,var.index);
    }
    return;
  }
  if (this.type == ARRAY) {
    int locals=writer.registerLocal();
    Variable arrayVar=this.var3;
    Variable indexVar=this.var1;
    Variable lengthVar=this.var2;
    org.objectweb.asm.Label scopeLabel=new org.objectweb.asm.Label();
    writer.writeLabel(scopeLabel);
    var.value.writeExpression(writer);
    var.index=locals + 1;
    indexVar.index=locals + 2;
    lengthVar.index=locals + 3;
    arrayVar.index=locals + 4;
    writer.writeInsn(Opcodes.DUP);
    arrayVar.writeSet(writer,null,null);
    writer.writeInsn(Opcodes.ARRAYLENGTH);
    lengthVar.writeSet(writer,null,null);
    writer.writeLDC(0);
    indexVar.writeSet(writer,null,null);
    writer.writeJumpInsn(Opcodes.GOTO,updateLabel);
    writer.writeLabel(startLabel);
    arrayVar.writeGet(writer,null);
    indexVar.writeGet(writer,null);
    writer.writeInsn(arrayVar.type.getArrayLoadOpcode());
    var.writeSet(writer,null,null);
    if (this.then != null) {
      this.then.writeStatement(writer);
    }
    writer.writeIINC(indexVar.index,1);
    writer.writeLabel(updateLabel);
    indexVar.writeGet(writer,null);
    lengthVar.writeGet(writer,null);
    writer.writeJumpInsn(Opcodes.IF_ICMPLT,startLabel);
    writer.resetLocals(locals);
    writer.writeLabel(endLabel);
    writer.writeLocal(var.name.qualified,var.type,scopeLabel,endLabel,var.index);
    writer.writeLocal("String_Node_Str","String_Node_Str",null,scopeLabel,endLabel,indexVar.index);
    writer.writeLocal("String_Node_Str","String_Node_Str",null,scopeLabel,endLabel,lengthVar.index);
    writer.writeLocal("String_Node_Str",arrayVar.type,scopeLabel,endLabel,arrayVar.index);
    return;
  }
}