Program: 83031
Project: 83031
Buggy source:
@Override public void writeInsn(int opcode) throws BytecodeException {
  if (opcode > 255) {
switch (opcode) {
case Opcodes.LCONST_M1:
      this.frame.push(ClassFormat.LONG);
    this.mv.visitLdcInsn(LONG_MINUS_ONE);
  return;
case Opcodes.BNOT:
this.frame.pop();
this.writeBoolJump(Opcodes.IFEQ);
return;
case Opcodes.INOT:
this.mv.visitInsn(Opcodes.ICONST_M1);
this.mv.visitInsn(Opcodes.IXOR);
return;
case Opcodes.LNOT:
this.mv.visitLdcInsn(LONG_MINUS_ONE);
this.mv.visitInsn(Opcodes.IXOR);
return;
case Opcodes.L2B:
this.frame.set(ClassFormat.BYTE);
this.mv.visitInsn(Opcodes.L2I);
this.mv.visitInsn(Opcodes.I2B);
return;
case Opcodes.L2S:
this.frame.set(ClassFormat.SHORT);
this.mv.visitInsn(Opcodes.L2I);
this.mv.visitInsn(Opcodes.I2S);
return;
case Opcodes.L2C:
this.frame.set(ClassFormat.CHAR);
this.mv.visitInsn(Opcodes.L2I);
this.mv.visitInsn(Opcodes.I2C);
return;
case Opcodes.F2B:
this.frame.set(ClassFormat.BYTE);
this.mv.visitInsn(Opcodes.F2I);
this.mv.visitInsn(Opcodes.I2B);
return;
case Opcodes.F2S:
this.frame.set(ClassFormat.SHORT);
this.mv.visitInsn(Opcodes.F2I);
this.mv.visitInsn(Opcodes.I2S);
return;
case Opcodes.F2C:
this.frame.set(ClassFormat.CHAR);
this.mv.visitInsn(Opcodes.F2I);
this.mv.visitInsn(Opcodes.I2C);
return;
case Opcodes.D2B:
this.frame.set(ClassFormat.BYTE);
this.mv.visitInsn(Opcodes.D2I);
this.mv.visitInsn(Opcodes.I2B);
return;
case Opcodes.D2S:
this.frame.set(ClassFormat.SHORT);
this.mv.visitInsn(Opcodes.D2I);
this.mv.visitInsn(Opcodes.I2S);
return;
case Opcodes.D2C:
this.frame.set(ClassFormat.CHAR);
this.mv.visitInsn(Opcodes.D2I);
this.mv.visitInsn(Opcodes.I2C);
return;
case ACMPEQ:
this.frame.pop();
this.frame.pop();
this.writeBoolJump(Opcodes.IF_ACMPEQ);
return;
case ACMPNE:
this.frame.pop();
this.frame.pop();
this.writeBoolJump(Opcodes.IF_ACMPNE);
return;
case Opcodes.OBJECT_EQUALS:
this.frame.pop();
this.frame.pop();
this.mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str",false);
this.frame.push(ClassFormat.BOOLEAN);
return;
case SWAP2:
this.frame.reserve(2);
this.mv.visitInsn(Opcodes.DUP2_X2);
this.mv.visitInsn(Opcodes.POP2);
return;
case Opcodes.AUTO_SWAP:
BackendUtil.swap(this);
return;
case Opcodes.AUTO_POP:
BackendUtil.pop(this);
return;
case Opcodes.AUTO_POP2:
BackendUtil.pop2(this);
return;
case Opcodes.AUTO_DUP:
BackendUtil.dup(this);
return;
case Opcodes.AUTO_DUP_X1:
BackendUtil.dupX1(this);
return;
}
if (opcode >= ICMPEQ && opcode <= ICMPLE) {
this.writeBoolJump(Opcodes.IF_ICMPEQ + opcode - ICMPEQ);
return;
}
return;
}
this.insnCallback();
this.frame.visitInsn(opcode);
if (opcode >= IRETURN && opcode <= RETURN || opcode == ATHROW) {
if (this.syncCount > 0) {
for (int i=0; i < this.syncCount; i++) {
this.mv.visitVarInsn(Opcodes.ALOAD,this.syncLocals[i]);
this.mv.visitInsn(Opcodes.MONITOREXIT);
}
}
this.visitFrame=true;
this.hasReturn=true;
}
this.mv.visitInsn(opcode);
}

Fixed version (ground truth):
@Override public void writeInsn(int opcode) throws BytecodeException {
  if (opcode > 255) {
switch (opcode) {
case Opcodes.LCONST_M1:
      this.frame.push(ClassFormat.LONG);
    this.mv.visitLdcInsn(LONG_MINUS_ONE);
  return;
case Opcodes.BNOT:
this.writeBoolJump(Opcodes.IFEQ);
return;
case Opcodes.INOT:
this.mv.visitInsn(Opcodes.ICONST_M1);
this.mv.visitInsn(Opcodes.IXOR);
return;
case Opcodes.LNOT:
this.mv.visitLdcInsn(LONG_MINUS_ONE);
this.mv.visitInsn(Opcodes.IXOR);
return;
case Opcodes.L2B:
this.frame.set(ClassFormat.BYTE);
this.mv.visitInsn(Opcodes.L2I);
this.mv.visitInsn(Opcodes.I2B);
return;
case Opcodes.L2S:
this.frame.set(ClassFormat.SHORT);
this.mv.visitInsn(Opcodes.L2I);
this.mv.visitInsn(Opcodes.I2S);
return;
case Opcodes.L2C:
this.frame.set(ClassFormat.CHAR);
this.mv.visitInsn(Opcodes.L2I);
this.mv.visitInsn(Opcodes.I2C);
return;
case Opcodes.F2B:
this.frame.set(ClassFormat.BYTE);
this.mv.visitInsn(Opcodes.F2I);
this.mv.visitInsn(Opcodes.I2B);
return;
case Opcodes.F2S:
this.frame.set(ClassFormat.SHORT);
this.mv.visitInsn(Opcodes.F2I);
this.mv.visitInsn(Opcodes.I2S);
return;
case Opcodes.F2C:
this.frame.set(ClassFormat.CHAR);
this.mv.visitInsn(Opcodes.F2I);
this.mv.visitInsn(Opcodes.I2C);
return;
case Opcodes.D2B:
this.frame.set(ClassFormat.BYTE);
this.mv.visitInsn(Opcodes.D2I);
this.mv.visitInsn(Opcodes.I2B);
return;
case Opcodes.D2S:
this.frame.set(ClassFormat.SHORT);
this.mv.visitInsn(Opcodes.D2I);
this.mv.visitInsn(Opcodes.I2S);
return;
case Opcodes.D2C:
this.frame.set(ClassFormat.CHAR);
this.mv.visitInsn(Opcodes.D2I);
this.mv.visitInsn(Opcodes.I2C);
return;
case ACMPEQ:
this.writeBoolJump(Opcodes.IF_ACMPEQ);
return;
case ACMPNE:
this.writeBoolJump(Opcodes.IF_ACMPNE);
return;
case Opcodes.OBJECT_EQUALS:
this.frame.pop();
this.frame.pop();
this.mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str",false);
this.frame.push(ClassFormat.BOOLEAN);
return;
case SWAP2:
this.frame.reserve(2);
this.mv.visitInsn(Opcodes.DUP2_X2);
this.mv.visitInsn(Opcodes.POP2);
return;
case Opcodes.AUTO_SWAP:
BackendUtil.swap(this);
return;
case Opcodes.AUTO_POP:
BackendUtil.pop(this);
return;
case Opcodes.AUTO_POP2:
BackendUtil.pop2(this);
return;
case Opcodes.AUTO_DUP:
BackendUtil.dup(this);
return;
case Opcodes.AUTO_DUP_X1:
BackendUtil.dupX1(this);
return;
}
if (opcode >= ICMPEQ && opcode <= ICMPLE) {
this.writeBoolJump(Opcodes.IF_ICMPEQ + opcode - ICMPEQ);
return;
}
if (opcode >= LCMPEQ && opcode <= DCMPLE) {
this.writeBoolJump(Opcodes.IF_LCMPEQ + opcode - LCMPEQ);
return;
}
return;
}
this.insnCallback();
this.frame.visitInsn(opcode);
if (opcode >= IRETURN && opcode <= RETURN || opcode == ATHROW) {
if (this.syncCount > 0) {
for (int i=0; i < this.syncCount; i++) {
this.mv.visitVarInsn(Opcodes.ALOAD,this.syncLocals[i]);
this.mv.visitInsn(Opcodes.MONITOREXIT);
}
}
this.visitFrame=true;
this.hasReturn=true;
}
this.mv.visitInsn(opcode);
}