Program: 83145
Project: 83145
Buggy source:
@Override public void writeStatement(MethodWriter writer) throws BytecodeException {
  dyvil.tools.asm.Label startLabel=this.startLabel.target=new dyvil.tools.asm.Label();
  dyvil.tools.asm.Label updateLabel=this.updateLabel.target=new dyvil.tools.asm.Label();
  dyvil.tools.asm.Label endLabel=this.endLabel.target=new dyvil.tools.asm.Label();
  Variable var=this.variable;
  Variable iteratorVar=this.iteratorVar;
  IType varType=var.getType();
  int lineNumber=this.getLineNumber();
  dyvil.tools.asm.Label scopeLabel=new dyvil.tools.asm.Label();
  writer.writeLabel(scopeLabel);
  var.getValue().writeExpression(writer,var.getType());
  writer.writeLineNumber(lineNumber);
  writer.writeInvokeInsn(Opcodes.INVOKEINTERFACE,"String_Node_Str","String_Node_Str","String_Node_Str",true);
  int locals=writer.localCount();
  iteratorVar.setIndex(locals);
  var.setIndex(locals + 1);
  writer.writeVarInsn(Opcodes.ASTORE,locals);
  writer.writeJumpInsn(Opcodes.GOTO,updateLabel);
  writer.writeTargetLabel(startLabel);
  writer.writeVarInsn(Opcodes.ALOAD,locals);
  writer.writeLineNumber(lineNumber);
  writer.writeInvokeInsn(Opcodes.INVOKEINTERFACE,"String_Node_Str","String_Node_Str","String_Node_Str",true);
  if (this.boxMethod != null) {
    writer.writeTypeInsn(Opcodes.CHECKCAST,this.boxMethod.getTheClass().getInternalName());
    this.boxMethod.writeInvoke(writer,null,null,lineNumber);
  }
 else {
    Types.OBJECT.writeCast(writer,varType,lineNumber);
  }
  writer.writeVarInsn(varType.getStoreOpcode(),locals + 1);
  if (this.action != null) {
    this.action.writeStatement(writer);
  }
  writer.writeLabel(updateLabel);
  writer.writeVarInsn(Opcodes.ALOAD,locals);
  writer.writeLineNumber(lineNumber);
  writer.writeInvokeInsn(Opcodes.INVOKEINTERFACE,"String_Node_Str","String_Node_Str","String_Node_Str",true);
  writer.writeJumpInsn(Opcodes.IFNE,startLabel);
  writer.resetLocals(locals);
  writer.writeLabel(endLabel);
  var.writeLocal(writer,scopeLabel,endLabel);
  iteratorVar.writeLocal(writer,scopeLabel,endLabel);
}

Fixed version (ground truth):
@Override public void writeStatement(MethodWriter writer) throws BytecodeException {
  dyvil.tools.asm.Label startLabel=this.startLabel.target=new dyvil.tools.asm.Label();
  dyvil.tools.asm.Label updateLabel=this.updateLabel.target=new dyvil.tools.asm.Label();
  dyvil.tools.asm.Label endLabel=this.endLabel.target=new dyvil.tools.asm.Label();
  Variable var=this.variable;
  Variable iteratorVar=this.iteratorVar;
  IType varType=var.getType();
  int lineNumber=this.getLineNumber();
  dyvil.tools.asm.Label scopeLabel=new dyvil.tools.asm.Label();
  writer.writeLabel(scopeLabel);
  var.getValue().writeExpression(writer);
  writer.writeLineNumber(lineNumber);
  writer.writeInvokeInsn(Opcodes.INVOKEINTERFACE,"String_Node_Str","String_Node_Str","String_Node_Str",true);
  int locals=writer.localCount();
  iteratorVar.setIndex(locals);
  var.setIndex(locals + 1);
  writer.writeVarInsn(Opcodes.ASTORE,locals);
  writer.writeJumpInsn(Opcodes.GOTO,updateLabel);
  writer.writeTargetLabel(startLabel);
  writer.writeVarInsn(Opcodes.ALOAD,locals);
  writer.writeLineNumber(lineNumber);
  writer.writeInvokeInsn(Opcodes.INVOKEINTERFACE,"String_Node_Str","String_Node_Str","String_Node_Str",true);
  if (this.boxMethod != null) {
    writer.writeTypeInsn(Opcodes.CHECKCAST,this.boxMethod.getTheClass().getInternalName());
    this.boxMethod.writeInvoke(writer,null,null,lineNumber);
  }
 else {
    Types.OBJECT.writeCast(writer,varType,lineNumber);
  }
  writer.writeVarInsn(varType.getStoreOpcode(),locals + 1);
  if (this.action != null) {
    this.action.writeStatement(writer);
  }
  writer.writeLabel(updateLabel);
  writer.writeVarInsn(Opcodes.ALOAD,locals);
  writer.writeLineNumber(lineNumber);
  writer.writeInvokeInsn(Opcodes.INVOKEINTERFACE,"String_Node_Str","String_Node_Str","String_Node_Str",true);
  writer.writeJumpInsn(Opcodes.IFNE,startLabel);
  writer.resetLocals(locals);
  writer.writeLabel(endLabel);
  var.writeLocal(writer,scopeLabel,endLabel);
  iteratorVar.writeLocal(writer,scopeLabel,endLabel);
}